Solved

Check for Returned Messages with IMAP/PHP

Posted on 2008-10-14
1
987 Views
Last Modified: 2013-11-29
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
Comment
Question by:hankknight
1 Comment
 
LVL 8

Accepted Solution

by:
RWJDCom earned 500 total points
ID: 22713826
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now