aspose 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 Spring in Action this week in the Spring 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: 42280
    
  64
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: 42280
    
  64
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unsent mail through javamail