Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Notify status of bounced email sent using Javamail API

 
cle tan
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already have a program to send the email using JavaAPI.
The catch is that if let's say if aaa@hotmail.com is an invalid email address, it still sends the mail out, and there's no way for my application to
detect that it is a invalid email address.
Assuming that the rebound email received in the email server in 5 sec, I would like to get some reply from the email server, saying that the email
was not sent successfully.

Is it possible?
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
cle tan
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but even when it sends successfully to the invalid email address, there is no exception produced.
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cle tan wrote:but even when it sends successfully to the invalid email address, there is no exception produced.

In the example you provided with your original post, "invalid" is invalid from your business perspective. From the javamail perspective, as long as it confirms to RFC 2822, it is a valid mail ID.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I couldn't put it better now than I put it back then :-)

The short version is: the code that sends the email can not do this check. You need to write separate code that checks the account used to send the mail for bounces.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic