Log in

View Full Version : How to tell if an email is read



kuau
01-08-2011, 05:41 PM
I have written a simple emailing script for a newsletter and would like to add the feature of being able to tell when the newsletter is received or viewed. Could this also indicate if the email is being filtered as spam?

Does anyone know how this can be added to the script?

Thanks very much.

Schmoopy
01-08-2011, 05:58 PM
I think it depends on the email client that person uses, some may not have this functionality.

The header you want to send with the email is:



<?php

$headers = 'From: youremail@email.com' . "\r\n" .
'Disposition-Notification-To: youremail@email.com';

mail('email@email.com', 'Subject', 'Message', $headers);

?>


As I said, this may not work 100% of the time, but try it out and see what happens.

As for the spam thing, that's something completely out of your control, and there's no way of knowing whether or not your email will go into someone's junk folder.

There are sites out there that can check your emails (at a cost) for "spammyness" if you're concerned about that.

Can't think of any off the top of my head, but google is your friend.

kuau
01-08-2011, 06:07 PM
Cool. I'll definitely try the headers method.

I've noticed that often simple emails get filtered as spam if they contain a link to a web page, or an image, but not always. I wish things were more predictable. Reliable communication is rather important.

traq
01-08-2011, 09:23 PM
A simple way (if you're using html emails) is to include a 1px image (like <img src="http://www.mysite.com/emailimages/transparent.gif?addressatemaildotcom) in the email, and use htaccess to monitor when it is requested. The query string does nothing, but it allows you to know which recipient looked at the email.

Of course, this sort of thing is also employed by scammers to know when they get a real "hit" from their email lists - which is why many email clients block external images by default.

djr33
01-09-2011, 07:30 PM
Most of what you've asked has been answered well. There's no way to force an answer to either of those, but using the tricks above is one way.

Regarding the spam issue, there is nothing that you can do to know if it was marked as spam, but you can do a lot to try to make sure that it is not marked as spam. If an individual chooses to block your newsletter (or if enough people do so that it becomes added to a shared spam list) then that's not something you can do anything about. However, if that is not the case, then there are a number of tricks you can use to make sure your email is in a presentable format so that automatic spam filters don't see it as "just more spam". Google this topic to read more, but some basics are: 1) use longer messages with content rather than just a few words; 2) use a real and unique subject; 3) use complete headers and don't do anything that looks like you're trying to send anonymously; 4) maybe look into whether your domain (from which the email is sent) is on any spam lists-- it probably won't be, but that would be a big problem; 5) in general do what you can to make it not seem like an automated message, even if it's generated automatically-- this mostly relates to content, and making it a unique email that filters don't see as useless.