Create a .eml (email) file in Java

前端 未结 5 823
不思量自难忘°
不思量自难忘° 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条回答
  •  我在风中等你
    2020-12-01 08:40

    You can construct javax.mail.Message object (or have it already constructed from the mail server) and then you can use writeTo() method to save it to file. See JavaMail API for more information.

提交回复
热议问题