This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unsent mail through javamail

 
divya kundapur
Ranch Hand
Posts: 110
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
divya kundapur
Ranch Hand
Posts: 110
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Ulf will be trying that
 
divya kundapur
Ranch Hand
Posts: 110
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 110
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic