Email validation in Java

Add a comment January 24th, 2007

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 | BlinkList

Popularity: 21% [?]

Bookmark this on BuzzURLBookmark this on BuzzURL Post to TwitterTweets for this web page Bookmark this on FC2 Bookmark newsing it! Choix it! Add to Google Bookmark Bookmark this on Delicious Digg This

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

  1. January 24th, 2007 at 11:30 | #1

    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 :P

  2. February 8th, 2007 at 05:02 | #2
    Megavannan

    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…..

  3. February 8th, 2007 at 05:05 | #3

    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

  4. February 28th, 2007 at 16:06 | #4

    Mmmm,ok it’s nice but why i use it while i can use Regular expression in an effcient way

    http://essamabdelaziz.wordpress.com

  5. October 8th, 2007 at 22:57 | #5
    harvey

    what does RFC standard the validator support, 822 or 2822? Looks it do only old RFC822.

  6. November 20th, 2007 at 15:47 | #6

    Thank You !!!!
    Its Work !!

  7. April 15th, 2008 at 10:19 | #7

    Nice works fine..

  8. June 22nd, 2008 at 06:11 | #8
    Helmi

    Great job!
    Thanks…

  9. July 14th, 2008 at 08:38 | #9
    adha

    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 ………

  10. November 20th, 2008 at 17:52 | #10
    Vishal

    Awesome…..This sounds a more professional approach and also saves time in writing one’s own implementation

  11. December 15th, 2008 at 18:45 | #11
    Pratibha

    Great Help

    Thanks !!

  12. December 16th, 2008 at 23:21 | #12
    tod

    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.

  13. May 4th, 2009 at 15:17 | #13

    Thanks for the great help :)

  14. July 22nd, 2009 at 08:43 | #14
    varun

    thanks for the help:)

  15. September 23rd, 2009 at 20:53 | #15
    daniel

    new URL the download …
    http://commons.apache.org/downloads/download_validator.cgi

  1. |
    July 9th, 2009 at 04:28 | #1

    [...] 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 [...]

Comments feed