0

there is a problem with sending messages to email address in cyrillic symbols using java.mail.internet.InternetAddress. When im trying to parse email address it checks every char to fit range between 040 and 0177 ASCII chars, and it fails if it enounters a cyrillic symbol.

And i'm looking for a solutin of that problem, probably any other package to create InternetAddress object for a email with cyrillic address.

Class InternetAddress -> line 1214 (method checkAddress).

Thanks in advance for any suggestions.

  • atm ive found two possible solutions: 1) pass String adress into parse method converting it with java.net.IDN.toASCII method 2) use InternetAddress.parseHeader(address, false) where it ignores address check but now looks like my mail server can not process cyrillic addresses – Revellion Sep 29 '14 at 13:56
  • address: хочуписьмо@письмо.рф ASCII: xn--@-otbbochcdcesfr0a5a8fg.xn--p1ai javax.mail.SendFailedException: com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Bad recipient address syntax at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1835) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1098) at javax.mail.Transport.send0(Transport.java:195) at javax.mail.Transport.send(Transport.java:124) Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Bad recipient address syntax at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1686) – Revellion Sep 29 '14 at 14:09

0 Answers0