Page 1 of 1

Get Failed Recipients

Posted: Wed Feb 21, 2007 1:05 am
by heureux
Hello Everyone,

I am trying to send batch-emails with swiftmailer. And, also i need to know how many have failed. Now, when i use getFailedRecipients with Log->enabled. I get the failed recipients where the email-id was incorrectly formatted (like mrinal@gmail) but when it's just that the email-id does not exist like (mrinal13241123242@gmail.com) but is correctly formated swiftmailer considers it as successful send.

The reason i can think of is that the email get queued up in SMTP server the error code (550: user does not exist) comes only after the script has stopped execution. So, it gets undetected.

Now is there a way to detect these error codes. Or, some swiftmailer function to read SMTP log files.

I am using Swiftmailer v3, PHP5, on WINXP, and hMailServer.

Thanks in advance

Posted: Wed Feb 21, 2007 1:15 am
by Chris Corbyn
Swift can't (reliably) detect if the email user doesn't exist. It's purely down to the SMTP server sending the email to report a bad recipient to Swift. If your SMTP server is not an MX for gmail.com then it can't tell if joe@gmail.com exists or not, it can only tell if gmail.com has a MX record. That's what it's probably checking. You can't tell who receives emails at initial sending time.

EDIT | Regarding reading the log:

Code: Select all

$swift->log->dump();