Skip to content

Commit ce41d9b

Browse files
committed
[Mailer] fixed SMTP support when a message cannot be sent
1 parent 26e57da commit ce41d9b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Transport/Smtp/SmtpTransport.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,13 @@ public function send(RawMessage $message, SmtpEnvelope $envelope = null): ?SentM
111111
$this->start();
112112
}
113113

114-
$message = parent::send($message, $envelope);
114+
try {
115+
$message = parent::send($message, $envelope);
116+
} catch (TransportExceptionInterface $e) {
117+
$this->executeCommand("RSET\r\n", [250]);
118+
119+
throw $e;
120+
}
115121

116122
$this->checkRestartThreshold();
117123

0 commit comments

Comments
 (0)