Validate Email Address using Java Mail API
In this tutorial you will find how to validate email address using java Mail API. You must to import javax.mail.internet.InternetAddress
In previous post I described How To Validate Email Address Using Java Regular Pattern
package jsupport; import javax.mail.internet.AddressException; import javax.mail.internet.InternetAddress; /** * * @author Jsupport http://javasrilankansupport.blogspot.com */ public class ValidateEmailAddress { public static boolean validateEmail(String email) { try { new InternetAddress(email).validate(); } catch (AddressException ex) { System.out.println("Error : " + ex.getMessage()); return false; } return true; } public static void main(String[] args) { validateEmail("info@jsupport.com"); } }