-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer] AbstractTransport silently doing nothing if no recipients set #35805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@jschaedl I got this also when trying the component back then maybe adding a log as there is a edit: I opened a PR for this |
Duplicate of #33753 |
fabpot
added a commit
that referenced
this issue
Apr 16, 2020
This PR was merged into the 4.4 branch. Discussion ---------- Mailer from sender fixes | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #35818, Fix #35805, Fix #33753 | License | MIT | Doc PR | n/a Commits ------- e885860 Fix From/Sender handling in Emails
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Today I struggled a bit with sending an email via the Mailer class.
Here is some example code of what tried to do:
The implementation and the mailer configuration looked fine to me, but the email was not send out. There was also no Exception that indicated what I probably did wrong.
So I debugged my code and could find this line in the
AbstractTransport
.https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Mailer/Transport/AbstractTransport.php#L68
As you can see the
AbstractTransport::send()
method is just returningnull
in case there are no recipients set, which means the transport is failing "silently" without sending the email. Ok, my bad, I forgot to set a recipient. Problem solved.But I was wondering, if this is intended behaviour? I actually would have expected an Exception telling me that I forgot to set a recipient.
The text was updated successfully, but these errors were encountered: