Get Failed Recipients

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
heureux
Forum Newbie
Posts: 1
Joined: Wed Feb 21, 2007 12:58 am

Get Failed Recipients

Post 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
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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();
Post Reply