Let's have a destructor clean up SMTP rather than doing it manually

This commit is contained in:
Synchro 2013-04-02 18:41:57 +02:00
parent 0642bf5901
commit 919c0fe41a
1 changed files with 9 additions and 0 deletions

View File

@ -545,6 +545,15 @@ class PHPMailer {
$this->exceptions = ($exceptions == true);
}
/**
* Destructor
*/
public function __destruct() {
if ($this->Mailer == 'smtp') { //Close any open SMTP connection nicely
$this->SmtpClose();
}
}
/**
* Sets message type to HTML.
* @param bool $ishtml