Click here to Skip to main content
Click here to Skip to main content

Email Tracker

, 13 May 2004
Rate this:
Please Sign up or sign in to vote.
Track the emails you sent to people and you'll get alerted when somebody opens the email. Are spammers using this kind of tracking?


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 )


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;


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
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

Comments and Discussions

GeneralEmail Tracking Complete code PinmemberNaniCh10-Jan-13 23:22 
GeneralMy vote of 5 Pinmember160419844-Apr-12 21:38 
QuestionEmail Tracker Pinmember160419844-Apr-12 20:39 
Questionhey,i didnt got it bro... :( PinmemberShubhamraj1-Oct-11 21:05 
Generaleffort tracking system code in ASP.NET with c# PinmemberSriamar7-Apr-08 20:10 
QuestionE mail tracker source code Pinmemberprasadtalla9-May-07 2:46 
QuestionCaught by mail scanner PinmemberNirav K Sarvaiya16-Nov-05 4:20 
AnswerRe: Caught by mail scanner PinmemberAlbert Pascual16-Nov-05 5:51 
QuestionRe: Caught by mail scanner PinmemberNirav K Sarvaiya16-Nov-05 6:14 
GeneralThe other way around PinsussAnonymous30-Sep-05 3:40 
GeneralEmail tracking is not so easy Pinsussinanc_gumus20-May-04 2:02 
GeneralRe: Email tracking is not so easy Pinmembermartininick10-Jun-04 11:55 
GeneralRe: Email tracking is not so easy PinmemberEEmadzadeh29-Jul-05 18:49 
GeneralRe: Email tracking is not so easy PinmemberWcohen6-Sep-05 18:03 
Generalwow.. PinmemberMorningZ19-May-04 4:22 
GeneralRe: wow.. PinmemberAORD19-May-04 21:15 
GeneralRe: wow.. PinmemberMorningZ20-May-04 4:32 
GeneralRe: wow.. PinmemberAlbert Pascual20-May-04 6:57 
GeneralRe: wow.. PinmemberAORD20-May-04 15:52 
GeneralRe: wow.. Pinmemberpvialoux24-May-04 0:09 
GeneralSource Code PinmemberTony Bermudez17-May-04 8:51 
GeneralRe: Source Code PinmemberAlbert Pascual17-May-04 8:53 
GeneralRe: Source Code PinmemberRogerio P22-May-04 12:38 
GeneralRe: Source Code PinmemberAlbert Pascual24-May-04 6:54 
GeneralRe: Source Code Pinmember160419845-Apr-12 3:06 
GeneralRe: Source Code Pinmemberzealcione23-May-04 7:23 
GeneralRe: Source Code Pinmemberreppin28-Apr-07 11:33 
GeneralRe: Source Code PinadminChris Maunder24-May-04 9:27 
GeneralRe: Source Code PinmemberAlbert Pascual24-May-04 9:41 
GeneralRe: Source Code Pinmemberzealcione24-May-04 15:17 
GeneralRe: Source Code PinmemberAlbert Pascual24-May-04 15:21 
GeneralRe: Source Code PinsussAnonymous24-Jan-05 1:31 
GeneralSource Code !! Pinmemberbarbosa_g@hotmail.com28-Feb-05 3:24 
GeneralRe: Source Code PinmemberRamaPavan20-Dec-11 4:48 
GeneralSpelling mistake... PinmemberJubjub16-May-04 19:42 
GeneralRe: Spelling mistake... PinmemberAlbert Pascual17-May-04 6:31 
GeneralRe: Spelling mistake... PinmemberAORD18-May-04 21:45 
GeneralRe: Spelling mistake... PinmemberJubjub19-May-04 1:19 
GeneralOutlook and others PinsitebuilderPaul Watson15-May-04 3:01 
GeneralRe: Outlook and others PinmemberAlbert Pascual19-May-04 6:33 
GeneralRe: Outlook and others PinsitebuilderPaul Watson19-May-04 6:39 
GeneralRe: Outlook and others PinmemberAlbert Pascual1-Aug-05 9: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.

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