You are here

public function PhpMailerSmtp::reset in PHPMailer SMTP 8

Same name and namespace in other branches
  1. 2.x src/Plugin/Mail/PhpMailerSmtp.php \Drupal\phpmailer_smtp\Plugin\Mail\PhpMailerSmtp::reset()
  2. 2.0.x src/Plugin/Mail/PhpMailerSmtp.php \Drupal\phpmailer_smtp\Plugin\Mail\PhpMailerSmtp::reset()
  3. 2.1.x src/Plugin/Mail/PhpMailerSmtp.php \Drupal\phpmailer_smtp\Plugin\Mail\PhpMailerSmtp::reset()

Re-initialize properties after sending mail.

1 call to PhpMailerSmtp::reset()
PhpMailerSmtp::smtpSend in src/Plugin/Mail/PhpMailerSmtp.php
Send mail via SMTP.

File

src/Plugin/Mail/PhpMailerSmtp.php, line 224

Class

PhpMailerSmtp
Implements the base PHPMailer SMTP class for the Drupal MailInterface.

Namespace

Drupal\phpmailer_smtp\Plugin\Mail

Code

public function reset() {
  $this
    ->clearAllRecipients();
  $this
    ->clearReplyTos();
  $this
    ->clearAttachments();
  $this
    ->clearCustomHeaders();
  $this->Priority = 3;
  $this->CharSet = 'utf-8';
  $this->ContentType = 'text/plain';
  $this->Encoding = '8bit';

  // Set default From name.
  $from_name = $this->config
    ->get('smtp_fromname');
  if ($from_name == '') {

    // Fall back on the site name.
    $from_name = $this->configFactory
      ->get('system.site')
      ->get('name');
  }
  $this->FromName = $from_name;
  $this->Sender = '';
  $this->MessageID = '';
}