• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1181
  • Last Modified:

Check for Returned Messages with IMAP/PHP

Hello,

I want to use PHP to connect to my IMAP server and retrieve a list of bounced messages.

So if I send out 10 messages and 5 bounce back I want to use PHP / IMAP to get a list of the 5 that bounced back.
0
hankknight
Asked:
hankknight
1 Solution
 
RWJDComCommented:
I found some good reading on this subject over at:
http://www.devarticles.com/c/a/PHP/Create-Your-Own-Mail-Script-With-PHP-and-IMAP/

That will teach you how to make your own mail script and then you can just use like preg_match to match the subjects listed below to see if the email has bounced:
        'Mail delivery failed',
        'Delivery Notification: Delivery has failed',
        'Non delivery report',
        'Returned mail',
        'Mail System Error - Returned Mail',
        'Undeliverable message',
        'Delivery Status Notification',
        'Nondeliverable mail',
        'Warning: could not send message',
        'Undeliverable Mail',
        'Undeliverable:',
        'Undelivered Mail Returned to Sender',
        'Failure Notice',
        'Delivery Failure',
        'Message status - undeliverable',
        'Mail could not be delivered',
        'Delivery unsuccessful',
        'Mail Delivery Problem',
        'delayed 24 hours',
        'delayed 48 hours',
        'delayed 72 hours',
        'delivery report',
        'failure delivery',
        'delivery notification',
        'mail status report',
        'error delivering mail',
        'mail not delivered',
        '**Message you sent blocked by our bulk email filter**',
        'Marked As Spam:',
        'delivery_failure'

I hope this helps.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now