[Webinar] Streamline your web hosting managementRegister Today


track open rate of email newsletter

Posted on 2010-04-03
Medium Priority
Last Modified: 2013-11-07
hi folks,

I am sending the newsletter to some of the users. I want to track whether they have opened the newsletter or not programmatically.

how can i achieve this?

Any help will be appreciated.
Question by:dotsandcoms
LVL 45

Expert Comment

ID: 29543138
>>I am sending...

You can't, the best you can hope for is to ask them to inform you they have done so.

Accepted Solution

darshan_derasari earned 1000 total points
ID: 29550146
Hi dotsandcoms,

I assume that you have a table which contains user information and also a table which
contains information related to newsletter sent to which user. Add a field named
"bOpened" to this newsletter sent table.

In the email content of newsletter add 1x1 pixel image at the bottom of source and set a
image source to point to the webpage located on your site which keeps track of opened
newsletter emails.

<img src="http://www.xyz.com/trackopenemail.aspx?newslettersentID=[PK]">

PK = Here you need to fill primary key from newsletter sent table.

In the trackopenemail.aspx page, you need to write necessary code which reads querystring
value and set bOpened = 1 for that record in newsletter sent table and also return 1X1
pixel image in response.

This way you can achieve this functionality.

Hope this helps.

Expert Comment

by:Gorkem Yuksel
ID: 29683526
If you have told your customers that you will be placing becon images in newsletters, then you are within your right to place a transparent 1px by 1px image inside your email.  Point this becon image to be an ASPX page that can keep track in a database of the number of hits to it.


Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.


Expert Comment

ID: 29713722
Its a tricky thing to do, because most mail clients will block images, because thats how spammers confirm a working email address, so your stats, if using images, wont be completely accurate.

Another way would be to require a read receipt, but a lot of web based emails dont support this, and even if it does, some people just ignore it or choose not to send it.

You could use a cheeky JavaScript that launched on page load to call a handler page that updated your database, but the user could be reading mail whilst offline, or the script could be blocked.

If this is a request from the marketing team, I'd advise them that there's no certain way of knowing how many people have read the newsletter :)

Author Comment

ID: 29756064
hi darshan_derasari,

how can i return the image in response.

I am using the below coding but not getting the image in return:

 PowerGeneralFunction objGen;
    string strQuery = "";

    protected void Page_Load(object sender, EventArgs e)
        if (Request.QueryString["campid"] == null)
            if (Request.QueryString["campid"].ToString() == "")

        if (Request.QueryString["emailid"] == null)
            if (Request.QueryString["emailid"].ToString() == "")

    protected string Camp_Details()
        int result = 0;
        objGen = new PowerGeneralFunction();

            strQuery = "Insert into campaignRead (campid,nemail,addedip,addeddate,readnl) values ( " + Request.QueryString["campid"].ToString().Replace("'", "&#39;") + ",'" + Request.QueryString["emailid"].ToString().Replace("'", "&#39;") + "','" + this.FinalIP() + "','" + System.DateTime.Now + "',1)";
            result = objGen.InsertUpdateDeleteCommand(strQuery);
            if (result > 0)
                return "http://www.cocoona.ae/images/knews.jpg";

        catch (Exception ex)
            return "http://www.cocoona.ae/images/knews.jpg";

            strQuery = "";
            objGen = null;

        return "http://www.cocoona.ae/images/knews.jpg";

    public string FinalIP()
        string strHostName = "";
        strHostName = System.Net.Dns.GetHostName();
        IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(strHostName);
        IPAddress[] addr = ipEntry.AddressList; return addr[addr.Length - 1].ToString();

Assisted Solution

the_bill earned 1000 total points
ID: 29769596
System.Drawing.Image myImage = System.Drawing.Image.FromFile(path);
MemoryStream tempStream = new MemoryStream();
Response.ContentType = "image/gif";

Author Closing Comment

ID: 31710521

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.
Suggested Courses
Course of the Month9 days, 10 hours left to enroll

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question