是否有可能捕获"消息-ID"与SmtpClient发送的电子邮件吗? [英] Is it possible to capture the "Message-ID" of an email message sent with SmtpClient?

查看:261
本文介绍了是否有可能捕获"消息-ID"与SmtpClient发送的电子邮件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 SmtpClient MAILMESSAGE 类.NET 的通过本地邮件服务器来发送电子邮件( hMailServer ),我目前所发现没有办法得到一个发送信息的邮件ID 标头值。



背后的想法



我试图以编程方式跟踪无法投递的邮件,所以我必须找到一个方法来识别从回复一个拒绝某个消息目标SMTP服务器。



现在我想的只是记住邮件ID SMTP头价值和解析传入邮件进行此ID。



我试图检查的 标题收集发送消息后,但我没有发现任何邮件ID



我的提问



是否有可能得到我的SMTP服务器 MAILMESSAGE 邮件ID 标头值$ C>实例?



更新2012-05-27



根据这个例子,我已经成功尝试手动生成一个邮件ID 我自己,只是在发送前。



我所有的例子工作至今,因此它的看起来的,这是我的问题的解决方案。


< DIV CLASS =h2_lin>解决方案

标准的解决你的问题是VERP。阅读伯恩斯坦的原创文章,找出为什么邮件ID 等。是不可靠的。 http://cr.yp.to/proto/verp.txt


Using the SmtpClient and MailMessage classes in .NET to send emails through a local mail server (hMailServer), I currently found no way to get the Message-ID header value of a sent message.

The idea behind

I'm trying to programmatically track messages that are undeliverable, so I have to find a way to identify replies from the destination SMTP server that rejects a certain message.

Now I thought of simply remembering the Message-ID SMTP header value and parse incoming mails for this ID.

I've tried to inspect the Headers collection after sending the message, but I did not find any Message-ID.

My question

Is it possible to get the Message-ID header value that my SMTP server adds during sending of a MailMessage instance?

Update 2012-05-27

As per this example I've successfully tried to manually generate a Message-ID on my own, just before sending.

All my examples work so far, so it seems that this is a solution to my question.

解决方案

The standard solution to your problem is VERP. Read Bernstein's original article to find out why Message-Id et al. are not reliable. http://cr.yp.to/proto/verp.txt

这篇关于是否有可能捕获&QUOT;消息-ID&QUOT;与SmtpClient发送的电子邮件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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