java - 使用 Java Mail API 向单独的收件人发送批量邮件

标签 java email jakarta-mail

我需要向数十或数百人发送同一条消息,而不必显示每个人的电子邮件地址。

我还需要跟踪对我发送的每封邮件所做的相应操作(即接收状态、打开状态等) 假设我一次以 50 个收件人的方式向 1000 个收件人发送消息。

当我以密件抄送模式发送电子邮件时,我可以将同一条消息发送给数十个人,而无需显示每个人的电子邮件地址。但在这里我无法跟踪对我发送的每封邮件所做的相应操作。

当我在正常模式下发送电子邮件时,我可以同时实现这两个目标,但处理所有 1000 个收件人需要很长时间。

有没有更好的方法来完成我需要的两项? 如果是这样,您能否与我们分享以解决问题。

最佳答案

我在 OTN Forum 上回答了您的问题。这是我的回应:

The only better way is to contract with a bulk mail service that will do all this for you.

Whether you can do better may depend on what exactly you mean by "track the respective action made to the each mail". If you want to know whether each recipient received the message or replied to the message, you need to send a different message to each recipient with some personally identifiable information. If you only want to know whether the message was delivered to each recipient successfully, and you're willing to depend on Delivery Status Notifications (which not all mail servers support), you can determine from the returned Delivery Status Notification whether delivery was successful or not for each recipient. But again, some servers won't return DSNs at all, and some won't return them in the standard format.

此外,我假设您已经尝试过仅使用单个连接向每个收件人发送不同的邮件副本,如其他答案中所述。如果您还没有尝试过,请从这里开始。 :-)

关于java - 使用 Java Mail API 向单独的收件人发送批量邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33775093/

相关文章:

PHP Mail - 发现多个或格式错误的换行符

java - 使用通过 Java Mail API (javax.mail.jar) 工作的 Apache Commons 电子邮件组件发送电子邮件是否需要 "sendmail service"?

java - Java 中无法读取 double

PHPMailer : MAIL not accepted from server: 530 5. 7.0 必须先发出 STARTTLS 命令

php - Google Apps 不会收到 PHP mail() 电子邮件

JavaMail 传输大型二进制 MIME 消息(rfc3030)

java.lang.RuntimeException : javax. mail.MessagingException : Could not connect to SMTP host: smtp. gmail.com,端口:465

java - 将特定于应用程序的项目(如 API、数据库模型)和特定于平台的项目分开是个好主意吗?

Java:循环和乘法

java - 多个线程可以同时将数据写入文件吗?