Solved

C#, VB6, Email

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Gmail subfolders appearing as empty within Outlook 2016 1 49
Run software updates from the website 6 49
SQL Server 2012 to SQL Server 2016 24 54
pop3 to imap? 11 39
We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
This story has been written with permission from the scammed victim, a valued client of mine – identity protected by request.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

737 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