File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes Unsent mail through javamail 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 "Unsent mail through javamail" Watch "Unsent mail through javamail" New topic
Author

Unsent mail through javamail

divya kundapur
Ranch Hand

Joined: Aug 21, 2007
Posts: 110
the method which i m using below is not able to catch the valid unsent mails, it shows them as valid sent mails, but actually the email ids are not valid and they are not used, there is something wrong with this code which i m not able to figure out, and suppose i have an email id as '1@0com' it is considering as valid email id



SCJP - 5.0
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41124
    
  45
The only check for a valid email address that's performed seems to be to pass the address to the InternetAddress constructor - which is pretty lenient. You may want to consider something stricter, like the EmailValidator class from Apache Commons Validator library in conjunction with TLD checking (which that class lacks).


Ping & DNS - my free Android networking tools app
divya kundapur
Ranch Hand

Joined: Aug 21, 2007
Posts: 110
thanks Ulf will be trying that
divya kundapur
Ranch Hand

Joined: Aug 21, 2007
Posts: 110
Ulf Dittmer wrote:The only check for a valid email address that's performed seems to be to pass the address to the InternetAddress constructor - which is pretty lenient. You may want to consider something stricter, like the EmailValidator class from Apache Commons Validator library in conjunction with TLD checking (which that class lacks).


I checked EmailValidator class from Apache Commons, most of its methods are deprecated. When i open the gmail account from which i m sending mails, i can see that it does not send mails to all email ids since i have given many wrong email ids, but the SendFailedException is not able to tell me that. How can i solve this issue. I need to store undelivered email ids to a file.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41124
    
  45
I checked EmailValidator class from Apache Commons, most of its methods are deprecated.

Not a single one of the methods is deprecated; what are you talking about?

org.apache.commons.validator.EmailValidator
divya kundapur
Ranch Hand

Joined: Aug 21, 2007
Posts: 110
Ulf Dittmer wrote:
Not a single one of the methods is deprecated; what are you talking about?

org.apache.commons.validator.EmailValidator


Ok, My mistake just checked and you are correct.
 
Don't get me started about those stupid light bulbs.
 
subject: Unsent mail through javamail
 
Similar Threads
java mail smtp host prob.
java mail smtp host prob.
sending mail to internet servers
Java Mail
SendFailedException for sending simple email by using JavaMail