Re: Legal email addresses for InternetAddress
Chris Burdess <[email protected]>
| Newsgroups | gmane.comp.java.classpath.extensions.javamail |
|---|---|
| Message-ID | <[email protected]> |
Øyvind Harboe wrote:
> I thought that the line below should throw an exception on *all*
> illegal
> email addresses:
>
> // this does not throw an exception
> new InternetAddress("ab#surelynotavalidemailaddress##!!!!cdef");
looks like a well-formed (local) address to me. which part are you
objecting to?
> // this does throw an exception
> new InternetAddress("@asdf");
> new InternetAddress("asdf@");
these are not well-formed.
see rfc 2822, section 3.4 for details.
--
Chris Burdess