PHP: Check who had read sent email?

Solution 1:

Add Header to email:

Disposition-Notification-To: [email protected]

As mentioned above it's not reliable and it's better to do something like this:

<img src="http://yourdomain.com/emailreceipt.php?receipt=<email of receiver>" />

And log it in a database, although again this is restricted by the email client's ability to show images and sometimes it may even put the mail into junk because it doesn't detect an image... a workaround that would be to actually outputting an image (say your logo) at the end of that script.

Edit: A quick lookup at the phpmailer class gave me the following:

$mail->ConfirmReadingTo = '[email protected]';

but it's the same as the Disposition-Notification-To method above.

Solution 2:

Send a beacon image in the emails like so

<img src='http://www.yourserver.com/beacon.php?email_id=$email_id&email_address=$user_address' style='width:1px;height:1px'>

And then use the beacon.php file to log the data. You will then want to output a 1X1 image with appropriate headers.

Important note
Many popular email clients (such as Gmail) now block external images, so this is by far, not fool proof.

Solution 3:

This is next to impossible to do 100% effectively.

  1. You could control where the content is stored e.g. http://www.example.com/34hg038g85gb8no84g5 and provide a link in the email to that content, you can then detect when that URL was viewed.

  2. Use a method used by MailChimp and other newsletter campaigns, put an invisible image in your email, this image should reside on a server you control, you can then detect when that image is hit when the user opens the email.

Solution 4:

It is not possible by definition.

Solution 5:

Mailreaders are not browsers, they don't support javascript. They don't even support proper CSS so dont expect too much. So I honestly don't see any way you can do what you're trying to do