为什么.NET SmtpClient发送的电子邮件缺少Message

编程入门 行业动态 更新时间:2024-10-18 10:13:57
本文介绍了为什么.NET SmtpClient发送的电子邮件缺少Message-Id?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

This is my SMTP settings in App.Config:

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

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

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/身份验证:普通密码/端口:587/安全性:STARTTLS

This is what I have in Thunderbird: host: mail.korax / 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

本文发布于:2023-11-17 12:23:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609992.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:电子邮件   NET   SmtpClient   Message

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!