Hello, I have tried the example msgsendsample.java (and other similar examples) that comes with JavaMail . If the recipient address does not exist, Transport.send would not throw an exception. How I can detect an invalid (i.e. non existing address)? Many thanks, Arsalan Madjd
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
You send mail and if it comes back rejected then the address doesn't exist. What are you trying to accomplish?
I am trying to send email within a Java application and would like to detect if the address I am sending to is invalid. Currently if the address in invalid, the "send" call goes through without any exception and the program terminates. Should I be waiting for the rejected email? Thanks, Arsalan
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
Originally posted by Arsalan Madjd: Should I be waiting for the rejected email?
You could wait but it might not be back for a few days. The question is, why do you want to know if it is invalid? Is it critical to your application?
Arsalan Madjd
Greenhorn
Joined: Feb 21, 2001
Posts: 10
posted
0
yes. It is a part of our requirements to detect the bounced emails. In my test program when send email to an invalid email address, I get an email notification from our mailer daemon within few minutes.
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
Originally posted by Arsalan Madjd: yes. It is a part of our requirements to detect the bounced emails. In my test program when send email to an invalid email address, I get an email notification from our mailer daemon within few minutes.
Not every bounced e-mail will return that quickly. Some may take awhile because the e-mail address you are sending to is temporarily down.
Thomas Paul
mister krabs
Ranch Hand
Joined: May 05, 2000
Posts: 13974
posted
0
Originally posted by Arsalan Madjd: yes. It is a part of our requirements to detect the bounced emails.
The question is why is that a requirement? Would it be feasible for example to send a test e-mail that the user must repsond to? Then you could send a url pointing to a servlet which would then verify that the user received the e-mail.
subject: Cannot detect invalid address in Java Mail