I\'m having problems with parse method when usising ñ
character:
essage.setRecipients(Message.RecipientType.TO, internetAddress.parse(\"somedir.
If you are still with this problem, I advise you to add double quotes to your unusual e-mail address like I did. It worked for me, because checkAddress method of InternetAddress give up to validate quoted address. That's the easy and quick solution.
Example:
unusual_email_without_at_sign_or_with_accentuátion (won't work)
"unusual_email_without_at_sign_or_with_accentuátion" (it works!)
The perfect and correct solution would be Java Team to fix InternetAddress class' bug that even receiving "strict=false" at constructor is checking the e-mail syntax, when it shouldn't.
Example of the bug:
InternetAddress i = new InternetAddress("unusual_email_without_at_sign_or_with_accentuátion ", false)
Example of the workaround solution:
InternetAddress i = new InternetAddress("\"unusual_email_without_at_sign_or_with_accentuátion\"", false)
The approach of creating a new class that extends Address won't work, since Transport.send() for some reason seems to validate again the address and the exception is also launched.
Please, let us know if it helped!