以编程方式验证电子邮件已到达交换邮箱
我有一项工作正在运行,它向我们的用户发送电子邮件,从而启动我们公司的工作流程。 有时,用户会发誓他们没有收到电子邮件 - 不过,当我们向邮件管理员提取交换报告时,十有八九它都在他们已删除的项目中。 :P
我希望能够以编程方式验证通过 .net C# (我认为是 System.Net.Mail)发送的消息是否已到达用户的邮箱。
这是 Exchange 2007,所有消息都是内部的。
I have a job that runs which sends out emails to our users to which starts off a work flow process in our company. Periodically, a user will swear up and down that they didn't receive the email - though, when we go to the mail administrator to pull an exchange report, 10 times out of 10 it's in their deleted items. :P
I'd like to be able to programmatically verify that messages sent via .net C# (System.Net.Mail I think) reached the user's mail box.
It's exchange 2007 and all messages are internal.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我看到有两种方法可以满足您的要求:
发送带有“送达确认”功能的电子邮件(而不是“已读收据”,正如 CoddeToGlory 所说,用户可以将其忽略)。 然后,只需监视通过任何适合您的方式接收这些确认的邮箱即可:Exchange Web 服务、Outlook+COM 或 VBA、MAPI...
使用 Exchange 的 powershell 接口并捕获以下输出Get-MessageTrackingLog 查找 StoreDriver + Deliver 事件。
I see two ways to do what you want:
Send emails with "delivery confirmation" On (not "read receipt", this can be dismissed by the user as CoddeToGlory said). Then it's jut a matter of monitoring the mailbox that receives these confirmations via any way it's appropiate to you: Exchange Web Services, Outlook+COM or VBA, MAPI, ...
Use the powershell interface to Exchange and capture the output of Get-MessageTrackingLog looking for StoreDriver + Deliver events.
System.Net.Mail 则不能。 您必须深入研究 Exchange 的 API 以确定某人的电子邮件帐户中是否存在电子邮件。
http://support.microsoft.com/kb/813349
You can't with System.Net.Mail. You'll have to dig through Exchange's APIs to determine if an email is present in someone's email account.
http://support.microsoft.com/kb/813349
设置一个帐户来捕获所有反弹。 这样你就会知道哪些达到了,哪些没有达到。 这是确保电子邮件到达的最佳方法。
或者,您可以通过消息标题添加已读回执(通过设置 Disposition-Notification-To)。 但同样,用户可以选择不阅读它......
Set an account for catching all bounce backs. In this way you will know which ones reached and which ones did not. This is the best way to ensure emails reached.
Alternatively you can add read reciepts via message headers(by setting the Disposition-Notification-To). but again, user can chose not to read it...