Solved

C#, VB6, Email

Posted on 2011-02-11
4
270 Views
Last Modified: 2012-05-11
Hi All

I have a CMS program that is written in VB6 that manages member databases for clubs etc.

Given the prevalence for Email trackers ie. Respond when someone opens your email or clicks on a link. I was looking to build this type of tracking into my app. This is not a SPAM program as batch emails are sent to only members in DB who are opted in for such contact.

I am happy to build this in either VB6 or Interop with C#.

Any ideas where I start with this, haven't found anything handy online.

FLOG51
0
Comment
Question by:FLOG51
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:jorge_toriz
ID: 34872659
1. Create a GenericHandler that renders an image of 1x1 pixels (blank content)
2. This handler will receive a QueryString variable, this variable will contain the unique id for your e-mail (I propose the use of GUID)
3. Each time your GenericHandler receives a request, it takes the query string variable and then you can update your database recording the activity.
4. In your e-mails, send an image element that points to your GenericHandler with the unique query string variable
0
 

Author Comment

by:FLOG51
ID: 34878344
Hi jorge_toriz:

Ok, I get the idea of what you are suggesting, but can't get my head around how an image can be triggered to send a response to Handler on email being opened.

Can you point me in the direction of some sample code on this subject?
Thanks
FLOG51
0
 
LVL 15

Accepted Solution

by:
jorge_toriz earned 500 total points
ID: 34879342
Tracker.ashx code:

<%@ WebHandler Language="C#" Class="Tracker" %>

using System;
using System.Web;
using System.IO;

public class Tracker : IHttpHandler
{
    public void ProcessRequest (HttpContext context)
    {
        context.Response.ContentType = "image/jpeg";

        string trackingId = context.Request.QueryString["ti"];
        if (trackingId != null && trackingId != string.Empty)
        {
            //Update your database to say that e-mail with this trackingId has been readed
            /*
             * In your e-mail you must add a code like this <a src="http://www.yourdomain.com/Tracker.ashx?ti=kfhywejdasuiefhiasgf" />
             * The value of "ti" query string variable must be unique (I suggest the use of Guid.NewGuid().ToString())
             */
        }
    }
    public bool IsReusable
    {
        get {
            return false;
        }
    }
}

You will be referencing this generic handler inside the e-mails that you will send to verify when your e-mail are being read
0
 

Author Closing Comment

by:FLOG51
ID: 34880198
Hi jorge_toriz

Spectacularly Perfect Answer:
Thanks very much, this gives me everything I needed to know.
Keep up the good work.
FLOG51
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Read this checklist to learn more about the 15 things you should never include in an email signature.
An analysis of the phishing scam that has been affecting Google users, along with steps to take for protection, as well as what to do if you receive one of the emails.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

695 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