正在发送邮件但没有消息 ID

发布于 2024-10-09 00:32:11 字数 340 浏览 0 评论 0原文

当使用 indy-10 的 tidMessage 组件发送邮件时,我收到来自客户邮件服务器的有趣拒绝:

550 Rejected: Message does not contains a Message-ID

即使使用 indy 自己的演示应用程序

http://www.indyproject.org/DemoDownloads/Indy_10_MailClient.zip

我该怎么做才能解决这个问题。谢谢!

I am getting interesting rejections from my clients mail server when sending a mail with indy-10's tidMessage component saying:

550 Rejected: Message does not contain a Message-ID

I get this even when using indy's own demo app

http://www.indyproject.org/DemoDownloads/Indy_10_MailClient.zip

what do I do to fix this. thanks!

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

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

发布评论

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

评论(2

时光瘦了 2024-10-16 00:32:11

它适用于 Indy9,也许在 10 中事情并没有改变太多:

    procedure AddMsgID(AMsg: TIdMessage);
    var
      id: AnsiString;
    begin
      id := GenerateUniqueMsgID;
      AMsg.MsgId := id;
      AMsg.AddHeader('Message-ID=' + id);
      // AMsg.ExtraHeaders.Values['Message-ID'] := id;
    end; // AddMsgID

It works with Indy9, maybe things haven't cahnged too much in 10:

    procedure AddMsgID(AMsg: TIdMessage);
    var
      id: AnsiString;
    begin
      id := GenerateUniqueMsgID;
      AMsg.MsgId := id;
      AMsg.AddHeader('Message-ID=' + id);
      // AMsg.ExtraHeaders.Values['Message-ID'] := id;
    end; // AddMsgID
枕头说它不想醒 2024-10-16 00:32:11

在将电子邮件编码到套接字或 TStream 时,Indy 10 中的 TIdMessage 有意省略“Message-Id”标头。您必须使用 TIdMessage.ExtraHeaders 属性,例如:

IdMessage1.MsgId := '...';
IdMessage1.ExtraHeaders.Values['Message-Id'] := IdMessage1.MsgId;

编辑:

作为此的后续操作 - TIdMessage 现已更新,其中处理“消息”的逻辑发生了变化-ID”和“In-Reply-To”标头:

https://www.indyproject.org/2016/09/12/logic-changes-in-tidmessage-regarding-message-id-and-in- reply-to-headers/

TIdMessage.MsgId 属性现在会生成“Message-ID”标头,无论电子邮件是否正在保存、流式传输或传输。因此您不再需要使用 ExtraHeaders 属性。

TIdMessage in Indy 10 intentionally omits the 'Message-Id' header when encoding an email to a socket or TStream. You will have to use the TIdMessage.ExtraHeaders property, eg:

IdMessage1.MsgId := '...';
IdMessage1.ExtraHeaders.Values['Message-Id'] := IdMessage1.MsgId;

EDIT:

As a followup for this - TIdMessage has now been updated with logic changes in how it handles the "Message-ID" and "In-Reply-To" headers:

https://www.indyproject.org/2016/09/12/logic-changes-in-tidmessage-regarding-message-id-and-in-reply-to-headers/

The TIdMessage.MsgId property now generates a "Message-ID" header regardless of whether the email is being saved, streamed, or transmitted. So you do not need to use the ExtraHeaders property anymore.

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