Solved

C#, VB6, Email

Posted on 2011-02-11
4
265 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this article we will discuss some EI Capitan Mail app issues and provide some manual process to resolve them.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

743 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now