diff --git a/src/PHPMailer.php b/src/PHPMailer.php index b214016f9..62c138209 100644 --- a/src/PHPMailer.php +++ b/src/PHPMailer.php @@ -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) {