Hi Aleksandr!
What is your Wildfly version?
Wildfly 8 has buggy Java Mail API. In Wildfly 9 and later proper encoding is done automatically, no need to `encodeText` manually.
--
Tair Sabirgaliev
Message: 1
Date: Mon, 6 Jun 2016 12:12:26 +0000
Subject: [keycloak-user] Email internationalization
Content-Type: text/plain; charset="koi8-r"
Hello everyone.
I found a bug when trying to send email from keycloak to users with encoding against English.
For example, when I try to send Russian message with subject "???????? ???? ??????? ??????" I see "????????????? ?????? ??????????? ?????" in my email.
I think you should update org.keycloak.email.DefaultEmailSenderProvider class with line
msg.setSubject(subject);
to
msg.setSubject(MimeUtility.encodeText(subject, "utf-8", "B"));
Thanks.
Nekrasov Aleksander,
Developer,
Center of Financial Techologies
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
Message: 2
Date: Mon, 6 Jun 2016 19:38:59 +0200
Subject: Re: [keycloak-user] Email internationalization
Message-ID:
Content-Type: text/plain; charset="utf-8"
Please create a JIRA. If you want to submit a PR that would be welcome as
well.
> Hello everyone.
>
> I found a bug when trying to send email from keycloak to users with
> encoding against English.
>
> For example, when I try to send Russian message with subject ?????????
> ???? ??????? ??????? I see ?????????????? ?????? ??????????? ?????? in my
> email.
>
>
>
> I think you should update org.keycloak.email.DefaultEmailSenderProvider
> class with line
>
> msg.setSubject(subject);
>
> to
>
> msg.setSubject(MimeUtility.*encodeText*(subject, *"utf-8"*, *"B"*));
>
>
>
> Thanks.
>
>
>
> Nekrasov Aleksander,
>
> Developer,
>
> Center of Financial Techologies
>
> _______________________________________________
> keycloak-user mailing list
>
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------