Link to home
Start Free TrialLog in
Avatar of stkoontz
stkoontzFlag for United States of America

asked on

Tracking Bouncebacks in PHPMailer

I'm setting up a registration system that will allow our administrators to send out emails using PHPMailer.  I'd like to track bouncebacks and remove bad email addresses.  Is there a way to do this in PHPMailer?

Thanks for giving me a hand,

Steve
ASKER CERTIFIED SOLUTION
Avatar of Marcus Bointon
Marcus Bointon
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of stkoontz

ASKER

Not the answer I was hoping for, but I appreciate your quick response.

Steve
Avatar of mlemos
mlemos

What you can do is to set the Return-Path address to where bounced messages go, in a way that you can identify what address is bouncing.

For instance if you send messages to user@domain.com you can set the bounce address to bounce-user=domain.com@yourdomain.com . Then you set your catch all mailbox in your domain to drop messages to a POP3 mailbox.

Then you can use a PHP POP3 class like this fetch the messages and check the To: header to figure where the bounce message was sent and parse it to extract the original sender address.

If you cannot set a catchall POP3 mailbox, you can still try parse the bounced messages sent to a specific bounce address with a PHP MIME message parser class like this to extract the addresses that are bouncing.

Here is also an article explains what I said in regards of processing inbound email messages in PHP that can be bounces as well.