File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes validation of mail id Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "validation of mail id" Watch "validation of mail id" New topic

validation of mail id

LakshmiNarayana vishnu
Ranch Hand

Joined: Aug 03, 2006
Posts: 39
If there is a mai id say:

How can i validate this mail id in java?
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Doing a quick Google search, I found a few solutions to your issue. Do read them and see which you could use/adapt to suit your cause.

SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
Hardly possible at all.
Mail addresses depend on the protocol used, the server implementation used (internal email may well dispense with domains for example in many organisations), etc. etc.
And verifying whether it's an existing address at all is next to impossible anyway, even if it is syntactically correct.
It would involve sending a message and checking whether an answer is received at some point (which may be weeks or months later if the owner of the address is slow to respond, and may never arrive if the owner (like me and ever more people) doesn't respond to such things which are practically only ever used to harvest email addresses for spammer and identity thieves).

I agree. Here's the link:
subject: validation of mail id
jQuery in Action, 3rd edition