Delivery reports and read receipts in PHP mail

Does anyone of you know off by hand what mail headers to add in order to get a read receipt and delivery report? This now being when you use the normal PHP mail function. No fancy add-on script / class like phpMail.


Solution 1:

For the reading confirmations:

You have to add the X-Confirm-Reading-To header.

X-Confirm-Reading-To: <address>

For delivery confirmations:

You have to add the Disposition-Notification-To header.

For usage details see RFC 3798.


General tip for stuff like this:

Use the mail client of your choice to generate an e-mail with the desired parameters, send it to yourself and look at the mail source.

There you can find the necessary headers added by the feature you are looking for. Then read the RFC or google for specific details on the header in question.

Solution 2:

Gmail blocks methods such as:

img src="http://yourdomain/tracking.php?id=EMAIL_ID" width="0" height="0"

This is because the image is retrieved from a proxy. Since the URL contains variables and not a real image file, the image will not be shown. The tracker would be useless.

I've personally experienced this as I build my own newsletter system.