Anybody knows how to do this? I got all the information of the email (body, subject, from , to, cc, bcc) and need to generate an .eml file out of it.
If you want to add HTML Stuff you have to add
content.setHeader("Content-Type", "text/html");
(as Marco Sulla said) but also change
message.setContent(multipart);
to
message.setContent(multipart,"text/html");