You are here

public function DrupalPHPMailer::__destruct in PHPMailer 7.4

Same name and namespace in other branches
  1. 5.2 includes/phpmailer.class.inc \DrupalPHPMailer::__destruct()
  2. 6.3 includes/phpmailer.class.inc \DrupalPHPMailer::__destruct()
  3. 6.2 includes/phpmailer.class.inc \DrupalPHPMailer::__destruct()
  4. 7.3 includes/phpmailer.class.inc \DrupalPHPMailer::__destruct()

Overrides PHPMailer::__destruct().

File

includes/phpmailer.class.inc, line 170
Implements the base PHPMailer for Drupal class.

Class

DrupalPHPMailer
Class for implementing the PHPMailer library in Drupal.

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();
}