Reputation: 4573
I have a HTML file and it's in UTF-16 LE BOM and I am using Java with simple java mail library (which uses jakarta mail internally) to send the mail. When I send the mail by attaching the HTML file, the receiver of the mail see some extra character ഀ
at every line ending in the attachment file.
I checked the raw email messages and the attachment is being added having header as Content-Transfer-Encoding: quoted-printable
also Content-Type: text/html; charset=UTF-8;
.
While sending email I am only detecting MIME type of the file and then give byte[], name of the attachment and detected MIME type to the simple java mail library, I assume that rest work is done either by simeple java mail library or by jakarta mail itself.
questions are:
charset
as UTF-8 where the file is in UTF-16? Don't they do the detection part?Also, rather than depending on library if I set header as Content-Transfer-Encoding: base64
then file is being send nicely without any extra character at the end.
Content-Transfer-Encoding
for any type of attachment?Upvotes: 0
Views: 35