使用java程序发送带有更改数据的html电子邮件 [英] send html email with changing data using java program

查看:57
本文介绍了使用java程序发送带有更改数据的html电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须发送html内容作为电子邮件。 html包含文件包含图像,链接,日期,名称等。

但是对于每个收件人,html字段中的名称将是他自己的名字。日期会在每天发生变化。并且每天都会更改html链接。

每天都无法手动更改它?

我正在使用java程序发送批量邮件,我写的。

有没有办法发送这样的html电子邮件?

如何每天自动设定日期?

如何改变使用java创建的GUI的新链接?

I have to send a html content as email. html contains file contains images,links,date,name etc.
But for each recipient, the name in html field will be his own name. And date will change in each day. And the html links will also get changed each day.
It is not possible to manually change it everyday?
And I am using a java program to send the bulk mail, written by me.
Is there any way to send such html email?
How can set date automatically each day?
And how can change the new link by a GUI created using java?

推荐答案

您只需要阅读内容并针对不同的收件人和链接进行修改。创建一个模板文件,以便您可以在发送之前找到单个字段并在消息中的这些点添加正确的信息。
You just need to read the content and modify it for the different recipients and links. Create a template file so that you can locate individual fields and add the correct information at those points in the message before sending it.


您应该使用JAVA Mail API。这是合适的。



这里有一些教程和有用的链接:



JavaMail API上的基础知识 [ ^ ]

是在oracle服务器上,不知道为什么他们不再托管它。很棒的来源。



All About Java邮件 [ ^ ] @ scribd.com



我可以建议先发送简单的短信,然后再扩展SMTP发送HTML消息,再添加附件。





请使用本地电子邮件服务器进行开发和测试。 HmailServer [ ^ ]是免费的,可以在任何Windows机器上运行。请注意自动禁止选项,在设置中禁用它可以节省大量的时间和精力。



Thunderbird portable [ ^ ]是一个简单的电子邮件客户端,可用于开发/测试。它很紧凑,通过这种方式,您可以将正常的电子邮件与开发完全分开。
You should use the JAVA Mail API for that. It''s suitable.

Here are some Tutorials and helpful links:

Fundamentals on the JavaMail API[^]
Was on oracle server, don''t know why they do not host it any more. Great source.

All About Java Mail[^] @ scribd.com

I can recommend to start with sending simple text messages, then to extend the SMTP to send HTML Messages, then add Attachments.


Please use a local Email Server for Development and Testing. HmailServer [^] is free and runs on any Windows machine. Please be aware of the auto-ban option in that, disabling that in the settings can save a lot of nerves and time.

Thunderbird portable[^] is a simple Email client which you can use for development / testing. It''s compact and this way you will have your normal emails completely separated from the development.


这篇关于使用java程序发送带有更改数据的html电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆