1

我正在尝试在电子邮件标题中添加一些与列表相关的标题行,但它不起作用..

msg.addHeader("List-ID", lmsg.getListId());
msg.addHeader("List-Archive", lmsg.getListId());
msg.setHeader("List-Post", lmsg.getListId());
msg.setHeader("List-Unsubscribe", lmsg.getListId());
msg.setHeader("X-Mailer", mailer);
msg.setSentDate(lmsg.getSendDate());
Transport.send(msg);

收到的邮件中没有任何列表标题行,但 x-mailer 行仍在其中...

我的错在哪里?

干杯

4

1 回答 1

1

There's nothing obviously wrong in your code so you'll need to debug it. Start here. Also, before sending the message add msg.writeTo(new FileOutputStream("msg.txt")); and then examine the msg.txt file to be sure it includes the headers. If it does, and they still don't show up in the recipient's mailbox, some server along the way is removing them.

于 2014-02-23T07:04:44.133 回答