tags:

views:

199

answers:

4

Hi, how i can track an email. i m using java for my server side for sending emails. i want to track them that whether it is deliverd , opened ... how i can do that ??

+1  A: 

I suppose you're sending it through SMTP. Whenever your mail is sent to your SMTP server, your java program has no control of it:

1) If you want to know if your mail has been delivered, you should contact your SMTP server somehow (if the SMTP server is outside your control then forget that) and see if your mail has been sent.

2) You can't know if a mail has been opened by its receiver. The maximum you can do is set a flag that the mail requires acknowledgement, but that depends if the user explicitly wants to send that acknowledgment. Other possibility is set some link to your site within the mail that should be clicked to see the content. You will be able to track if the user clicked that link.

rossoft
You *can* know (if an email has been opened by the recipient, per @brianegge's answer). It may not be 100% depending on blocked images, but it is possible.
AdaTheDev
Yes, it is a modified approach of my #2 suggestion,instead of a link, an image is used
rossoft
+1  A: 

This is not a Java specific issue.

  1. You can create an HTML email, and embed an invisible gif which will report back to your server. Some software like Outlook and some web mail programs will block this for untrusted emails.
  2. You can request a return receipt. Many mail programs ignore this entirely, and the ones which don't usually ask the user if they want to send it.

Example:

email.AddHeaderField("Disposition-Notification-To","<[email protected]>")
brianegge
+2  A: 

There is no way to ensure that you always get the delivery or open-message notification.

Mailservers may accept the mail and drop it afterwards. users may read the mail but dismiss the notification.

"Webbugs" (aka images in the html source of the mail that include a special token that allows the mail to be recognized) don't work in most email programs.

As a matter of fact it's very unlikely that you can see that someone got the message.

What you could do is to keep the message on your server and only send a link. If the user clicks that you can be pretty sure that he got the message. But thankfully many users would not click on such links because it's used in fraud and spam.

Patrick Cornelissen
A: 

In case you send HTML email, you could add a 1x1 pixel image with some tracking parameters, that calls back to your webserver. It's not 100% reliable since some email clients (and users) block images in emails.

AJK