Possible Duplicate:
Swiftmailer 4 does not retrieve bounces as $failedRecipients
I am using SwiftMailer to send email through my GMail account using SMTP.
I have got everything setup perfectly and I can send emails without any problems.
The documentation says that send()
should return 0
if no messages are sent successfully and populate an array (i've called it $failures
), with the failed email addresses.
The issue I am seeing is that if I send an email to a non-existant address (asdfasdf@thisdomaindoesnotexist1111.com
), I get a reply from GMail:
Mail Delivery Subsystem mailer-daemon@googlemail.com
9:06 PM (6 minutes ago)
to me
Delivery to the following recipient failed permanently:
asdfasdf@thisdomaindoesnotexist1111.com
Technical details of permanent failure:
DNS Error: Domain name not found
----- Original message -----
However, swiftmailer still returns a 1 (1 message successfully sent) and the $failures
array remains empty.
Since the connection is encrypted with SSL, I don't think I can sniff and look at the packets with wireshark.
My hunch is that GMail's SMTP server returns a success while it generates an email regarding the failure and sends it to the sending address.
Is this correct? If so, are there any ways to catch the failures in PHP?