Friday 09 April 2010

PHP Mail Delivery and Read ReceiptsPHP Mail Delivery and Read Receipts

Left QuoteHave you ever used the Delivery Receipt / Read Receipt options in Microsoft Outlook? If you haven't ... try it - if your recipient uses Microsoft Exchange, you will get a 'Delivery Status Notification' email immediately, and when the mail is opened, you should receive a 'Read:'

Wouldn't it be great if you could add this functionality to emails sent from your website? Well, there's good news, bad news and worse news.

The good news is that the SMTP standard allows a Message Disposition Notification which specifies a return email address that the mail client can send a confirmation receipt to. This is your Read Receipt and can be implemented in PHP using the following code:

$headers = "From: Your Name<>\n";
$headers.= "Disposition-Notification-To: <>\n";
@mail("", "Receipt Test", "Send me a read receipt", $headers);

The bad news is that this is "advisory in nature" which means that the user can always decline to return the receipt. In Outlook and Outlook Express, the notification is a "xxx requested a read receipt be sent when the message is read. Do you want to send a receipt?" message, and the read receipt will only be sent if the user clicks Yes.

The worse news is that the Delivery Receipt is non-standard, and only usable if the email is sent from, and received by Microsoft Exchange.

It may only be half-useful, but that's better than nothing.Right Quote

Next article: Browser Comparison (01 September 2010)

Next Websites article: Sending PHP Email From IIS (02 February 2011)


Raj Says:

16th September 2013 at 15:41

like web siite

Add your comments




9 * 9 = (this security question stops automated submissions)