Click here to Skip to main content
Licence 
First Posted 13 May 2004
Views 147,498
Bookmarked 58 times

Email Tracker

By | 13 May 2004 | Article
Track the emails you sent to people and you'll get alerted when somebody opens the email. Are spammers using this kind of tracking?

Introduction

Sample image

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=\&quot;http://www." + 
                 sDomain + "/emailtrack.aspx?emailsent=" + sEmail + 
                 "\" width=1>";
   return (sRet); 
}

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 )
        StampSentEmail(Request.Params["emailsent"].ToString());
}

Response.Redirect("none.gif");

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;

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Albert Pascual

Web Developer

United States United States

Member

Al is just another Software Engineer working in C++, ASp.NET and C#. Enjoys snowboarding in Big Bear, and wait patiently for his daughters to be old enough to write code and snowboard.
 
Al is a Microsoft ASP.NET MVP
 
Blog

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralSource Code PinmemberTony Bermudez7:51 17 May '04  
GeneralRe: Source Code PinmemberAlbert Pascual7:53 17 May '04  
GeneralRe: Source Code PinmemberRogerio P11:38 22 May '04  
GeneralRe: Source Code PinmemberAlbert Pascual5:54 24 May '04  
GeneralRe: Source Code Pinmember160419842:06 5 Apr '12  
GeneralRe: Source Code Pinmemberzealcione6:23 23 May '04  
GeneralRe: Source Code Pinmemberreppin10:33 28 Apr '07  
Albert.
 
I have just joined and found your email tracking source code but it doesn't work, please help.
Geoff.
nfornipper@hotmail.co.uk
 
reppin

GeneralRe: Source Code PinadminChris Maunder8:27 24 May '04  
GeneralRe: Source Code PinmemberAlbert Pascual8:41 24 May '04  
GeneralRe: Source Code Pinmemberzealcione14:17 24 May '04  
GeneralRe: Source Code PinmemberAlbert Pascual14:21 24 May '04  
GeneralRe: Source Code PinsussAnonymous0:31 24 Jan '05  
GeneralSource Code !! Pinmemberbarbosa_g@hotmail.com2:24 28 Feb '05  
GeneralRe: Source Code PinmemberRamaPavan3:48 20 Dec '11  
GeneralSpelling mistake... PinmemberJubjub18:42 16 May '04  
GeneralRe: Spelling mistake... PinmemberAlbert Pascual5:31 17 May '04  
GeneralRe: Spelling mistake... PinmemberAORD20:45 18 May '04  
GeneralRe: Spelling mistake... PinmemberJubjub0:19 19 May '04  
GeneralOutlook and others PinsitebuilderPaul Watson2:01 15 May '04  
GeneralRe: Outlook and others PinmemberAlbert Pascual5:33 19 May '04  
GeneralRe: Outlook and others PinsitebuilderPaul Watson5:39 19 May '04  
GeneralRe: Outlook and others PinmemberAlbert Pascual8:05 1 Aug '05  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120529.1 | Last Updated 14 May 2004
Article Copyright 2004 by Albert Pascual
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid