为什么.NET SmtpClient发送的电子邮件缺少Message-Id? [英] Why emails sent by .NET SmtpClient are missing Message-Id?

查看:120
本文介绍了为什么.NET SmtpClient发送的电子邮件缺少Message-Id?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我在App.Config中的SMTP设置:

This is my SMTP settings in App.Config:

<system.net>
    <mailSettings>
      <smtp from="Reminder &lt;reminder@myserver.com&gt;">
        <network host="mail.myserver.net" port="587" password="my password" userName="reminder@myserver.com" enableSsl="true"/>
      </smtp>
    </mailSettings>
  </system.net>

这就是我发送电子邮件的方式:

And this is how I'm sending the emails:

message.SubjectEncoding = System.Text.Encoding.UTF8;
message.BodyEncoding = System.Text.Encoding.UTF8;
smtpClient.Send(message);

这正在工作!但是唯一的问题是,我的电子邮件将进入垃圾邮件文件夹,这是因为它们的标头中缺少Message-Id.我在Thunderbird中使用了相同的帐户,当我使用Thunderbird发送电子邮件时,已将Message-Id添加到我的电子邮件中,但是从我的应用程序发送的电子邮件中却没有发生.

this is working ! but the only problem is, my emails are going to spam folder and that's because they are missing Message-Id in their header. I use the same account in Thunderbird, when I send emails using thunderbird the Message-Id is added to my emails but it's not happening for the emails that are sent from my application.

我可以手动添加标题,例如:

I can add the header manually with something like :

message.Headers.Add("Message-Id","<3BD50098E401463AA228377848493927-1>");

但是该ID不是有效的message-id,我仍然会收到负面的垃圾邮件评分.知道为什么会这样吗?

But this Id is not a valid message-id and I will still get negative spam score for it. Any idea why this is happening ?

这是我在雷鸟中拥有的东西:
主持人:mail.korax.net/
身份验证:普通密码/
端口:587/
安全性:STARTTLS

This is what I have in Thunderbird:
host: mail.korax.net /
authentication: normal password /
port: 587 /
security: STARTTLS

推荐答案

您的SMTP服务器必须配置为自动包含邮件ID.如果生成自己的ID,则应遵循 RFC 2822第3.6.4节.

Your SMTP server has to be configured to automatically include the message ID. If generating your own ID, it should follow RFC 2822 Section 3.6.4.

这篇关于为什么.NET SmtpClient发送的电子邮件缺少Message-Id?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆