by
149 11
2
6
299k
3
Top 1% !
Popular
Pearl of Wisdom
Easy-to-find
Specified
OpenSource
Popularity: 3783rd place
Created
Modified Jul 25, 2014
InputName0email
InputType0String
Languagejava
LicenseMIT_X11
MethodNameisValidEmailAddress
OutputTypeboolean

Simple e-mail validator

This is a simple email validator which can be used in forms to check whether a given email address is valid or not.
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/98796/Simple-e-mail-validator?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
public static boolean isValidEmailAddress(String email) { boolean result = true; try { InternetAddress emailAddr = new InternetAddress(email); emailAddr.validate(); } catch (AddressException ex) { result = false; } return result; }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus