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.
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.