问题描述
当我发送带有indy-10的tidMessage组件的邮件时,我的客户邮件服务器拒绝了我,这很有趣:
I am getting interesting rejections from my clients mail server when sending a mail with indy-10's tidMessage component saying:
550拒绝:邮件不包含Message- ID
550 Rejected: Message does not contain a Message-ID
即使使用Indy自己的演示应用程序,我也会得到这个
I get this even when using indy's own demo app
该如何解决此问题。谢谢!
what do I do to fix this. thanks!
推荐答案
在将电子邮件编码为套接字或TStream时,Indy 10中的TIdMessage故意省略了 Message-Id标头。您将必须使用TIdMessage.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 := ...';
IdMessage.ExtraHeaders.Values['Message-Id'] := IdMessage1.MsgId;
编辑:
对此的后续操作- TIdMessage
现在已更新,其处理消息ID的方式发生了逻辑变化和 In-Reply-To标头:
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:
TIdMessage。 MsgId
属性现在将生成 Message-ID标头,无论是否保存,流传输或传输电子邮件。因此,您不再需要使用 ExtraHeaders
属性。
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.
这篇关于发送邮件但没有消息ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!