Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to track an email in Java?

Tags:

java

email

How I can track an email?

I' m using java on the server side for sending emails. I want to track whether it is delivered , opened, etc... How I can do that ?

like image 754
g.revolution Avatar asked Nov 17 '09 08:11

g.revolution


People also ask

Can we send email using Java?

Sending emails using Simple Java Mail is pretty straightforward. First, you need to create an email object using EmailBuilder . Then, you need to create a mailer object using MailerBuilder and pass the email object to the mailer object to send the email.

What is email tracking what are the benefits Email Tracking?

Email tracking notifies you when any email you sent has been opened or clicked. Email tracking software places an invisible image pixel in your emails that can detect the exact time and date an email has been opened by a recipient.


2 Answers

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]>")
like image 108
brianegge Avatar answered Nov 15 '22 21:11

brianegge


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.

like image 39
Patrick Cornelissen Avatar answered Nov 15 '22 20:11

Patrick Cornelissen