wood burning stoves*
The moose likes Other JSE/JEE APIs and the fly likes Notify status of bounced email sent using Javamail API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Notify status of bounced email sent using Javamail API" Watch "Notify status of bounced email sent using Javamail API" New topic
Author

Notify status of bounced email sent using Javamail API

cle tan
Ranch Hand

Joined: Jun 11, 2012
Posts: 68
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

Joined: Jul 26, 2007
Posts: 10172
    
    8

You might want to take a look at http://www.coderanch.com/t/453931/java/java/handle-wrong-mail-address-sending


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
cle tan
Ranch Hand

Joined: Jun 11, 2012
Posts: 68
but even when it sends successfully to the invalid email address, there is no exception produced.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10172
    
    8

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
Marshal

Joined: Mar 22, 2005
Posts: 41155
    
  45
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.


Ping & DNS - my free Android networking tools app
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Notify status of bounced email sent using Javamail API
 
Similar Threads
using java mail API
Updating the Assignment Log
problem sending mail with attachments-getting filenotfound exception
Accessing custom email headers in bounced back emails
no promotional emails flag not working :-(