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

7 Responses to “Email validation in Java”


  1. 1 Jason January 24, 2007 at 11:30 am

    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. 2 Megavannan February 8, 2007 at 5:02 am

    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. 3 Lijin February 8, 2007 at 5:05 am

    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. 4 essamabdelaziz February 28, 2007 at 4:06 pm

    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. 5 harvey October 8, 2007 at 10:57 pm

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

  6. 6 Vyor November 20, 2007 at 3:47 pm

    Thank You !!!!
    Its Work !!

  7. 7 ITGalary Forum April 15, 2008 at 10:19 am

    Nice works fine..

Leave a Reply




View Lijin Joseji's profile on LinkedIn

Disclaimer

The information on this site is for informational purposes only. The use of any Trademark or Copyrighted material is not intended to infringe Copyright. This blog is intended to be used under a policy of personal and non commercial use.

Adds

Add to Google

Blog Stats

  • 109,204 hits

Categories