File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

verification of existence of email id

 
Dinesh Babu
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Could any one of u pl suggest a way to verify the existence of an e mail Id using java code.

Thanks
Dinesh Babu.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can check if it is a VALID email address by checking it against the corresponding RFC.
This mainly means there must be an @-sign somewhere in there with something in front and behind.
Then you could try a DNS lookup of the part after the @-sign. If that doesn't exist it's pointing to a non-existing domain and would therefore never arrive (not quite sure here, it is possible that for example dummy.somisp.sometld would arrive is only somisp.sometld is a valid DNS entry).
The part in front of the @-sign you can only determine the validity of by actually trying to send to the address. If you get a bounce (which may take a long time to arrive, some mailservers try repeatedly for a day or more to deliver in case a client address is only temporarilly unavailable) the address certainly does not exist.
If you get no bounce someone has received your message, but that may well be a blacklist and no recipient will ever read it.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Welcome to JavaRanch!
The SMTP standard includes a "VRFY" command which you used to be able to use to verify whether an email address was valid at a particular host. Nowadays, virtually all sites implement this as a no-op, so it's pretty much useless.
The only way that works is to send an email to the address containing a unique URL. The email should instruct the recipient to visit the URL. A servlet at the URL can then record that the corresponding email is valid.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic