I am trying to figure out when the user opens an email that i sent to him. I am sending an html email with an image in it. This image is handled by a generic handler. At the moment this handler is not hit. Is this a good way of achieving my goal?
public void ProcessRequest(HttpContext context)
{
byte[] byteArray = System.IO.File.ReadAllBytes(@"c:\temp\Desert.jpg");
context.Response.Clear();
context.Response.ContentType = "image/bmp";
context.Response.BinaryWrite(byteArray);
}
the email body looks like this:
"<html><head><title></title></head><body><form name='form1' method='post' action='Default.aspx'><div><img id='Image1' src='ImageHandler.ashx?img=1' style='border-width:0px;' /></div></form></body></html>";
a couple of years ago I was faced with the same issue. I used your same exact approach, although this was a business requirement, so it was implicit for every member of the company to allow images coming from this specific email address. So every time someone opened an email, the generic handler would change something on the database, and we knew who opened an email. This was limited somewhat though. People using Outlook had to Double Click the email in order for this to work. Previewing the email was not enough for some reason I can’t recall at the moment. This is kind of a trick though, so if this is not a Company’s email, your best bet would be to actually send a hyperlink. Those interested in it will click on it and you will be able to see who actually saw your email. If not, I would not recommend this approach, cause as ibid mentioned this is kind of privacy-invasive. Good luck on your quest!