簡體   English   中英

JavaMail Api列表標頭不起作用

[英]JavaMail Api listing header doesnt work

我正在嘗試在電子郵件標題中添加一些與列表相關的標題行,但是它不起作用。

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行仍在其中...

我的錯在哪里?

干杯

您的代碼中顯然沒有什么錯,因此您需要對其進行調試。 這里開始。 同樣,在發送消息之前,添加msg.writeTo(new FileOutputStream(“ msg.txt”));。 然后檢查msg.txt文件以確保它包含標題。 如果是這樣,並且它們仍然沒有出現在收件人的郵箱中,則一路上的某些服務器正在將其刪除。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM