Click here to Skip to main content
12,512,130 members (57,452 online)
Click here to Skip to main content
Add your own
alternative version

Stats

177.1K views
2.5K downloads
63 bookmarked
Posted

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?

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

Share

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

Blog

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralEmail Tracking Complete code Pin
NaniCh10-Jan-13 22:22
memberNaniCh10-Jan-13 22:22 
GeneralMy vote of 5 Pin
160419844-Apr-12 20:38
member160419844-Apr-12 20:38 
QuestionEmail Tracker Pin
160419844-Apr-12 19:39
member160419844-Apr-12 19:39 
Questionhey,i didnt got it bro... :( Pin
Shubhamraj1-Oct-11 20:05
memberShubhamraj1-Oct-11 20:05 
Generaleffort tracking system code in ASP.NET with c# Pin
Sriamar7-Apr-08 19:10
memberSriamar7-Apr-08 19:10 
QuestionE mail tracker source code Pin
prasadtalla9-May-07 1:46
memberprasadtalla9-May-07 1:46 
QuestionCaught by mail scanner Pin
Nirav K Sarvaiya16-Nov-05 3:20
memberNirav K Sarvaiya16-Nov-05 3:20 
AnswerRe: Caught by mail scanner Pin
Albert Pascual16-Nov-05 4:51
memberAlbert Pascual16-Nov-05 4:51 
QuestionRe: Caught by mail scanner Pin
Nirav K Sarvaiya16-Nov-05 5:14
memberNirav K Sarvaiya16-Nov-05 5:14 
GeneralThe other way around Pin
Anonymous30-Sep-05 2:40
sussAnonymous30-Sep-05 2:40 
GeneralEmail tracking is not so easy Pin
inanc_gumus20-May-04 1:02
sussinanc_gumus20-May-04 1:02 
GeneralRe: Email tracking is not so easy Pin
martininick10-Jun-04 10:55
membermartininick10-Jun-04 10:55 
GeneralRe: Email tracking is not so easy Pin
EEmadzadeh29-Jul-05 17:49
memberEEmadzadeh29-Jul-05 17:49 
GeneralRe: Email tracking is not so easy Pin
Wcohen6-Sep-05 17:03
memberWcohen6-Sep-05 17:03 
Generalwow.. Pin
MorningZ19-May-04 3:22
memberMorningZ19-May-04 3:22 
GeneralRe: wow.. Pin
AORD19-May-04 20:15
memberAORD19-May-04 20:15 
GeneralRe: wow.. Pin
MorningZ20-May-04 3:32
memberMorningZ20-May-04 3:32 
GeneralRe: wow.. Pin
Albert Pascual20-May-04 5:57
memberAlbert Pascual20-May-04 5:57 
GeneralRe: wow.. Pin
AORD20-May-04 14:52
memberAORD20-May-04 14:52 
GeneralRe: wow.. Pin
pvialoux23-May-04 23:09
memberpvialoux23-May-04 23:09 
GeneralSource Code Pin
Tony Bermudez17-May-04 7:51
memberTony Bermudez17-May-04 7:51 
GeneralRe: Source Code Pin
Albert Pascual17-May-04 7:53
memberAlbert Pascual17-May-04 7:53 
GeneralRe: Source Code Pin
Rogerio P22-May-04 11:38
memberRogerio P22-May-04 11:38 
GeneralRe: Source Code Pin
Albert Pascual24-May-04 5:54
memberAlbert Pascual24-May-04 5:54 
GeneralRe: Source Code Pin
160419845-Apr-12 2:06
member160419845-Apr-12 2:06 
GeneralRe: Source Code Pin
zealcione23-May-04 6:23
memberzealcione23-May-04 6:23 
GeneralRe: Source Code Pin
reppin28-Apr-07 10:33
memberreppin28-Apr-07 10:33 
GeneralRe: Source Code Pin
Chris Maunder24-May-04 8:27
adminChris Maunder24-May-04 8:27 
GeneralRe: Source Code Pin
Albert Pascual24-May-04 8:41
memberAlbert Pascual24-May-04 8:41 
GeneralRe: Source Code Pin
zealcione24-May-04 14:17
memberzealcione24-May-04 14:17 
GeneralRe: Source Code Pin
Albert Pascual24-May-04 14:21
memberAlbert Pascual24-May-04 14:21 
GeneralRe: Source Code Pin
Anonymous24-Jan-05 0:31
sussAnonymous24-Jan-05 0:31 
GeneralSource Code !! Pin
barbosa_g@hotmail.com28-Feb-05 2:24
memberbarbosa_g@hotmail.com28-Feb-05 2:24 
GeneralRe: Source Code Pin
RamaPavan20-Dec-11 3:48
memberRamaPavan20-Dec-11 3:48 
GeneralSpelling mistake... Pin
Jubjub16-May-04 18:42
memberJubjub16-May-04 18:42 
GeneralRe: Spelling mistake... Pin
Albert Pascual17-May-04 5:31
memberAlbert Pascual17-May-04 5:31 
GeneralRe: Spelling mistake... Pin
AORD18-May-04 20:45
memberAORD18-May-04 20:45 
GeneralRe: Spelling mistake... Pin
Jubjub19-May-04 0:19
memberJubjub19-May-04 0:19 
GeneralOutlook and others Pin
Paul Watson15-May-04 2:01
sitebuilderPaul Watson15-May-04 2:01 
GeneralRe: Outlook and others Pin
Albert Pascual19-May-04 5:33
memberAlbert Pascual19-May-04 5:33 
GeneralRe: Outlook and others Pin
Paul Watson19-May-04 5:39
sitebuilderPaul Watson19-May-04 5:39 
GeneralRe: Outlook and others Pin
Albert Pascual1-Aug-05 8:05
memberAlbert Pascual1-Aug-05 8:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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
Web02 | 2.8.160929.1 | Last Updated 14 May 2004
Article Copyright 2004 by Albert Pascual
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid