Let's have a destructor clean up SMTP rather than doing it manually
This commit is contained in:
parent
0642bf5901
commit
919c0fe41a
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue