Solved

Check for Returned Messages with IMAP/PHP

Posted on 2008-10-14
1
1,087 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

724 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