This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
After reading the API documentation, I would have to say... I don't know. The expression
is equivalent to
in which "the detailed syntax of the address isn't checked", or so says the documentation. On the other hand the documentation also says "The address is parsed using "strict" parsing". So you might want to experiment a bit with those constructors to see what they actually do. However I'm dubious of the value of validating e-mail addresses anyway so I wouldn't (and didn't) worry about it.
However one issue is, if I use this class to validate the email address only (do use other features of Java Mail API), I have to use the mail.jar which adds additional size to my application.
So I think for this case, it's better to use a simple regular expression for the validation.
How deep are you wanting to validate the email address? Syntax is one thing, but if you want to check whether the domain and/or email address actually exists then you have to do a bit more work. See the following class: