Skip to content

Commit

Permalink
Reset SMTP session after error with keepalive (#2138)
Browse files Browse the repository at this point in the history
Fixes: #2137
  • Loading branch information
mscdex committed Sep 21, 2020
1 parent 17ab94e commit 7851021
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/PHPMailer.php
Expand Up @@ -1610,6 +1610,9 @@ public function postSend()
return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
}
} catch (Exception $exc) {
if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true) {
$this->smtp->reset();
}
$this->setError($exc->getMessage());
$this->edebug($exc->getMessage());
if ($this->exceptions) {
Expand Down

0 comments on commit 7851021

Please sign in to comment.