Email validation in Java
Validating the mail very effectively, is little difficult. Most of the programers will search for a code for this to make their work easier. Here is a simple code for validating your email in Java. It is using the apache.commons-validator jar and oro-gump-18012007.jar.
// Code email validation
public static boolean validateEmailAddress(String sEmail){
EmailValidator emailValidator = EmailValidator.getInstance();
return emailValidator.isValid(sEmail);
}
We can do the email validation using regx. This is another way of doing it effectively. If this post helped you then please leave one comment here ![]()
Downloads : apache.commons-validator.jar, oro-gump-18012007.jar
Technorati tags: Email validation
Book Mark it-> del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Netscape | Yahoo | BlinkListPopularity: 23% [?]
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.
I must say I’ve never looked at commons-validator before… I must say: I’ve been missing out! Very cool stuff (typical of most of the commons).
The only problem I’ve had recently with commons was when I downloaded fileupload, only to find that it now has a dependency on io. Meh… I like my API’s to have velocity style “dep” JAR’s that include all the dependencies, so that I don’t have to download them…. I’m lazy
hi
please give me the exact path to download the apache.commons-validator.jar file…. am not able to get the path… please help me immediately…..
Hi
This is the link http://jakarta.apache.org/site/downloads/downloads_commons-validator.cgi
click on the binary zip link 1.3.1.zip there
Hope you got…..
Lijin
Mmmm,ok it’s nice but why i use it while i can use Regular expression in an effcient way
http://essamabdelaziz.wordpress.com
what does RFC standard the validator support, 822 or 2822? Looks it do only old RFC822.
Thank You !!!!
Its Work !!
Nice works fine..
Great job!
Thanks…
how about if got many emai such as ,
to send : abc@gmail.com,sty@mail.com,and others..
can it validate list of email or just .. only one ………
Awesome…..This sounds a more professional approach and also saves time in writing one’s own implementation
Great Help
Thanks !!
This doesn’t allow blanks, which are legal char in the front part of the email addresses. It doesn’t cover more recent standards, thus is now deprecated.
Thanks for the great help
thanks for the help:)
new URL the download …
http://commons.apache.org/downloads/download_validator.cgi
[...] Email validation in Java Published January 24, 2007 Java , code , email 13 Comments Validating the mail very effectively, is little difficult. Most of the programers will search for a code for this to make their work easier. Here is a simple code for validating your email in Java. Click here to Read Full Article [...]