Java:如何创建可在 Outlook 中打开的带有附件的 EML 或 MSG 文件
我有一个 struts-action,当调用该操作时,我想创建并返回一个可以在 Outlook 中打开的简单 eml 或 msg 文件。
这可以通过基本的电子邮件消息来完成。我刚刚将 Outlook 中的一封电子邮件另存为 eml 并研究了其内容。然后在我的操作中创建一个字符串,并将其作为具有正确内容类型和扩展名的流返回。
但是当我想在消息中添加附件时,我想我需要一些帮助。 是否有任何免费的 api 可以帮助我构建带有附件的格式良好的 eml/msg 文件?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没关系。
我自己找到了解决方案。
Java Mail API 是正确的选择!这太简单了,我简直不敢相信,我什至考虑过购买第 3 方扩展
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