diff --git a/src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php b/src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php index 54f5e2a09655..7c3e074aee33 100644 --- a/src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php +++ b/src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php @@ -111,7 +111,13 @@ public function send(RawMessage $message, SmtpEnvelope $envelope = null): ?SentM $this->start(); } - $message = parent::send($message, $envelope); + try { + $message = parent::send($message, $envelope); + } catch (TransportExceptionInterface $e) { + $this->executeCommand("RSET\r\n", [250]); + + throw $e; + } $this->checkRestartThreshold();