no error on faulty target-address?

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
japanitrat
Forum Newbie
Posts: 12
Joined: Sat May 12, 2007 10:34 pm

no error on faulty target-address?

Post by japanitrat »

hi,


i heard only the best about swiftmailer, so i decided to set one up on my homeserver.
emails goin out, all fine.

the problem is: "notexistinguser@notexistingdomain.tld" will not detected as faulty target address at runtime, but returned to the specified return-path as "failure notice".

is there a way to detect this (with swift) without those bounce-to-boxes?

here my code:

Code: Select all

$swift =& new Swift($smtp);
$swift->log->enable();

$message = new Swift_Message($_REQUEST["subject"], $_REQUEST["message"]);
$message->setReturnPath($_REQUEST["failbox"]);

if(!$swift->send($message, $_REQUEST["email"], $_REQUEST["origin"])) echo "error occured"; // never called

$swift->disconnect();

print_r($swift->log->getFailedRecipients());  // ever returns an empty array ...
building/sending upon $_REQUEST just used for testing.
using Swift-3.2.1-php5
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

My email reply wrote:Hi,

Swift will only give an error if your SMTP server does. If your SMTP server accepts the mail but subsequently bounces it there's not a lot Swift can do. You can check MX addresses at runtime but the overhead of doing this is huge. If your SMTP server had given anything but a 250 response this would not have happened ;)

Most SMTP servers have an option in their config files to "verify domain".

Best Regards,

Chris
japanitrat
Forum Newbie
Posts: 12
Joined: Sat May 12, 2007 10:34 pm

Post by japanitrat »

hm okay, than i might ask a non-swiftmailer question.
does somebody know a good facility to parse those return- & bounce-to boxes, where failure emils go to?
Post Reply