Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 struts 动作,当调用该动作时,我想创建并返回一个可以在 Outlook 中打开的简单 eml 或 msg 文件。
使用基本的电子邮件消息就可以做到这一点。我刚刚从 Outlook 中将电子邮件保存为 eml 并研究了它的内容。然后在我的操作中创建了一个字符串,并将其作为具有正确内容类型和扩展名的流返回。
但是当我想在消息中添加附件时,我想我需要一些帮助。是否有任何免费的 api 可以帮助我构建带有附件的格式良好的 eml/msg 文件?
没关系。我自己找到了解决方案。
Java Mail API 是必经之路!太简单了,我不敢相信我什至考虑过购买第 3 方 ext