I need to send HTML having content in different languages. my configuration are :
MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_18_19002270.1337852743826"
------=_Part_18_19002270.1337852743826 Content-Type: text/html; charset=Cp1252 Content-Transfer-Encoding: quoted-printable
and in mail am getting all characters as ?. Can anybody suggest me how to set encoding so that i could get mail in proper language.
Thanks
found the solution:)
MimeBodyPart htmlPart = new MimeBodyPart();
htmlPart.setContent(bodyText, "UTF-8");
htmlPart.setText(bodyText, "utf-8");
htmlPart.setHeader("Content-Type","text/html; charset=\"utf-8\"");
htmlPart.setHeader("Content-Transfer-Encoding", "quoted-printable");
Still am not able to encode Subject line.
This piece of code might help you. 🙂
EDIT:
Here is the method I’ve used to set the encoding of subject line.