8000 [Mailer] Get failing email addresses · Issue #33812 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Mailer] Get failing email addresses #33812

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

Closed
thafirstone opened this issue Oct 2, 2019 · 3 comments
Closed

[Mailer] Get failing email addresses #33812

thafirstone opened this issue Oct 2, 2019 · 3 comments
Labels

Comments

@thafirstone
Copy link
thafirstone commented Oct 2, 2019

Description
Hi,
I'm looking for a way to display the email addresses to which the message was not sent.

Example
Something like that used to exist on Swiftmailer

$failure = [];

        if (!$this->mailer->send($message, $failure)) {
            ....
        } 

With $failure containing the emails to which the message was not sent

@thafirstone thafirstone changed the title [Mailer] Display failing email addresses [Mailer] Get failing email addresses Oct 2, 2019
@fabpot
Copy link
Member
fabpot commented Oct 2, 2019

There is a big difference between Swiftmailer and Symfony Mailer. As we only care about transactional emails, an exception is thrown when there is a problem. So, if the email was not sent, you will get an exception. That does not means that the email will be received if there is no exception, just that it was sent.

@fabpot fabpot closed this as completed Oct 2, 2019
@ro0NL
Copy link
Contributor
ro0NL commented Oct 3, 2019

@thafirstone the failed recipients are an artifact of Swift_RfcComplianceException, thus holds the invalid address (you can validate this yourself as well, before sending)

ultimately only the transport can tell us something was delivered yes/no, or attempted to at least.

@torian257x
Copy link

@ro0NL not sure what you mean with artifact but at least it seems that https://github.com/swiftmailer/swiftmailer/blob/master/lib/classes/Swift/Transport/AbstractSmtpTransport.php#L491 does actually catch \Swift_TransportException so at the least it is not only \Swift_RfcComplianceException

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
0