You are here

public function DrupalPHPMailer::Reset in PHPMailer 8.3

(Re-)initialize properties after sending mail.

2 calls to DrupalPHPMailer::Reset()
DrupalPHPMailer::SmtpSend in src/Plugin/Mail/DrupalPHPMailer.php
Send mail via SMTP.
DrupalPHPMailer::__construct in src/Plugin/Mail/DrupalPHPMailer.php
Constructor.

File

src/Plugin/Mail/DrupalPHPMailer.php, line 149

Class

DrupalPHPMailer
Implements the base PHPMailer class for the Drupal MailInterface.

Namespace

Drupal\phpmailer\Plugin\Mail

Code

public function Reset() {
  $this
    ->ClearAllRecipients();
  $this
    ->ClearReplyTos();
  $this
    ->ClearAttachments();
  $this
    ->ClearCustomHeaders();
  $this->Priority = 3;

  /**
   * @todo Need to find out where this variable comes from.
   */

  //    $this->CharSet     = variable_get('smtp_charset', 'utf-8');
  $this->ContentType = 'text/plain';
  $this->Encoding = '8bit';

  // Set default From name.
  $from_name = \Drupal::config('phpmailer.settings')
    ->get('smtp_fromname');
  if ($from_name == '') {

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