I wrote a java code to send a html eMail. For this I use jakarta.mail.
For the first try I got wrong characters in my eMail Client. I could fix it by using following code:
htmlPart.setContent(new String(mailTextContent.getBytes("UTF8"),"ISO-8859-1"), "text/html");
after using this code, on my development computer (Ubuntu) the mail works pretty fine. What I got can you pls. see in following, snipped which has the right encoding:
German ä,ö and Euro (€) is correct.
Now I deployed the jar file to my ubuntu server (docker)
After deploying I get following picture:
In the sourcecode of the wrong eMail is following included:
------=_Part_0_1847509784.1659876554470
Content-Type: text/html; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: quoted-printable
In the sourcecode of the correct eMail is following included:
------=_Part_0_2050835901.1659876395597
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
In both cases the client is the same. It looks like, that on my ubuntu server is an other behavior like on my ubuntu client
My html code starts with:
<!DOCTYPE html>
<html lang="de">
<head>
<title>mailtest</title>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
</head>
<body>
</b>
<table border=''1''....
Is there any idea/hint how can I prevent such an impact? Thank you in advance