track open rate of email newsletter

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.
dotsandcomsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AndyAinscowFreelance programmer / ConsultantCommented:
>>I am sending...

You can't, the best you can hope for is to ask them to inform you they have done so.
0
darshan_derasariCommented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gorkem YukselCommented:
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.

Cheers,

G.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

the_billCommented:
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 :)
0
dotsandcomsAuthor Commented:
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() == "")
            {
                Response.Redirect("http://www.cocoona.ae/");
            }
        }

        if (Request.QueryString["emailid"] == null)
        {
            if (Request.QueryString["emailid"].ToString() == "")
            {
                Response.Redirect("http://www.cocoona.ae/");
            }
        }

        this.Camp_Details();
    }
    protected string Camp_Details()
    {
        int result = 0;
        objGen = new PowerGeneralFunction();


        try
        {
            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";

        }
        finally
        {
            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();
    }
0
the_billCommented:
System.Drawing.Image myImage = System.Drawing.Image.FromFile(path);
MemoryStream tempStream = new MemoryStream();
myImage.Save(tempStream,ImageFormat.Gif);
Response.ClearContent();
Response.ContentType = "image/gif";
Response.BinaryWrite(tempStream.ToArray());
Response.End();
0
dotsandcomsAuthor Commented:
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.