简体   繁体   中英

Java: How to create an EML or MSG file with attachment that can be opened in Outlook

I have a struts-action, and when that action is called i would like to create and return a simple eml or msg file that can be opened in outlook.

This is can do just fine with a basic email-message. I just saved an email as eml from outlook and studied its content. Then created a string in my action and returned it as a stream with the correct content-type and extension.

But when i would like to add an attachement to the message i guess i would need some help. Is there any free api's out there that can help me construct a well-formed eml/msg file with an attachment?

Never mind. I found the solution myself.

Java Mail API is the way to go! It was so simple i cant belive i even considered buying a 3rd party exte

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM