You are here

public function PhpMailerSmtp::__destruct 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::__destruct()
  2. 2.0.x src/Plugin/Mail/PhpMailerSmtp.php \Drupal\phpmailer_smtp\Plugin\Mail\PhpMailerSmtp::__destruct()
  3. 2.1.x src/Plugin/Mail/PhpMailerSmtp.php \Drupal\phpmailer_smtp\Plugin\Mail\PhpMailerSmtp::__destruct()

Overrides PHPMailer::__destruct().

File

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

Class

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

Namespace

Drupal\phpmailer_smtp\Plugin\Mail

Code

public function __destruct() {

  // Disable debug output if SMTP keep-alive is enabled.
  // PHP is most likely shutting down altogether (this class is instantiated
  // as a static singleton). Since logging facilities (e.g., database
  // connection) quite potentially have been shut down already, simply turn
  // off SMTP debugging. Without this override, debug output would be printed
  // on the screen and CLI output.
  if ($this->SMTPKeepAlive && isset($this->smtp->do_debug)) {
    $this->smtp->do_debug = 0;
  }
  parent::__destruct();
}