如何使用Java在电子邮件正文中添加word新闻信函文档?

发布于 2024-11-19 12:50:01 字数 85 浏览 3 评论 0原文

我正在尝试发送一封包含图像和链接的新闻信。我有一个word文档格式的模板。有没有一种方法可以使用 Java 邮件将这个 Word 文档附加到电子邮件正文中?

I am trying to send a news letter which would includes images and links. I have the template designed in the word document format. Is there a way that I could attach this word document in the body of the email with the contents using Java mail?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

偏爱你一生 2024-11-26 12:50:01

以下是带有附件的电子邮件示例: http://www.jguru.com/ faq/view.jsp?EID=30251

顺便说一句,如果您问我,我建议您发送不带附件的电子邮件,但使您的电子邮件正文看起来像您拥有的模板。为此,请使用 MS Word 打开模板,然后将其另存为 HTML 文件。现在您有了 HTML 模板。打开并发现它。我确信我会找到在哪里插入您的文字。您可以自己实现一种简单的模板引擎(通过用真实文本替换某种标记)或使用现成的模板引擎(如速度)。因此,您可以生成带有图片等且不带附件的美观电子邮件。请记住:只有 10% 的收件人会打开您的电子邮件,也只有 10% 的人会打开附件。

Here is an example of email with attachment: http://www.jguru.com/faq/view.jsp?EID=30251

BTW if you ask me I'd recommend you to send email without attachment but make your email body to look like template you have. To do this open your template using MS word, then save it as HTML file. Now you have HTML template. Open and discover it. I am sure I will find where to insert your text. You can implement a sort of simple template engine yourself (by replacing some kind of marks by real text) or use ready template engines (like velocity.) As a result you can generate good looking email with pictures etc and without attachments. Remember: only 10% of your recipient will open your email and only 10% of them will open the attachment.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文