Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c128d50

Browse filesBrowse files
committed
bug #30787 [Mailer] Fix SMTP support when a message cannot be sent (fabpot)
This PR was merged into the 4.3-dev branch. Discussion ---------- [Mailer] Fix SMTP support when a message cannot be sent | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Commits ------- 3d25c1c [Mailer] fixed SMTP support when a message cannot be sent
2 parents 086f4a2 + 3d25c1c commit c128d50
Copy full SHA for c128d50

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed

‎src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php
+7-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.