Create a .eml (email) file in Java

前端 未结 5 824
不思量自难忘°
不思量自难忘° 2020-12-01 07:50

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.

5条回答
  •  猫巷女王i
    2020-12-01 08:30

    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");
    

提交回复
热议问题