I was interested to see how spammers are tacking emails and I thought to create something like that .This little project shows you how to track emails you sent by adding a little track quote at the end. I also create it a program to remove this kind of tracking and flag the email as SPAM.
Using the code
There is only one function to use: AddTracking(string sBody, string sEmail, string sDomain)
private string AddTracking(string sBody, string sEmail, string sDomain)
string sRet = sBody + "<IMG height=1 src=\"http://www." +
sDomain + "/emailtrack.aspx?emailsent=" + sEmail +
This function will add a LINK IMG at the end of the email that when loaded will actually be an ASPX page, that will alert you. Outlook and any mail editor that loads images will call the emailtrack.aspx with the parameter you added in the email. This is an error in the code above, I took the character '<' out so will display in this article.
Actually because I am addid HTML in the code, is difficult to see, I don't know how to make sure the article shows that code without adding weird formats
The Tracking page is pretty simple when receives the request:
if ( Page.IsPostBack == false )
if ( Request.Params["emailsent"] != null )
So when the email editor (Outlook, Netscape) makes the request, the answer will be a transparent image, so won't show on the email.
You need to make sure you send an HTML email. The demo project uses the Mail namespace from .NET. On that class you must set
mailMsg.BodyFormat = MailFormat.Html;