Javax.mail.internet.InternetAddress UTF-8 in the local part

I am looking for a solution to send mail to UTF-8 encoded mail addresses. Part of the domain is not a problem, because I can encode it using punycode and send it then.

But how do I handle the local part of the mailing address? For example, do I want to send an email to mü ller@testdomain.com ? javax.mail.internet.InternetAddresssays this is not a valid address.

Any suggestions?

+4
source share
2 answers

Javamail does not support SMTPUTF8 (as defined in RFC6531, local part ), as shown by Bugreport still open . A quick search did not lead to the creation of another supporting Java library. Apache email, for example. also depends on Javamail.

Update: JavaMail 1.6.0 which now supports international email addresses (RFC 6530/6531/6532) has been released since July 2017. Apache Commons Email 1.5 (August 2017) unfortunately is still dependent on JavaMail 1.5.6 .

+2
source

Have you tried if URL encoding is working? Thus, it will be as follows: m%C3%BCller@testdomain.com.

0
source

Source: https://habr.com/ru/post/1623951/


All Articles