How to track an email in Java?

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]>")

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.

Tags:

Java

Email