How do I check if an email address string is valid, like, both for a valid/working domain name and for address within domain?

Tripp Lilley

Use the javax.mail.internet.InternetAddress class from the JavaMail API.

Note that there is no way to verify that an address actually exists and is a working "inbox" short of sending a message to it and waiting to receive a "bounce" message indicating some kind of delivery failure. The best you can hope to do is validate that the form of the address conforms to governing standards.

The governing standard, in this case, is the IETF's RFC 822 - STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact