在Outlook中获取已发送邮件的MessageID [英] Get MessageID of a sent mail in Outlook

查看:641
本文介绍了在Outlook中获取已发送邮件的MessageID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在写Outlook VSTO加载项.使用此插件,我想跟踪电子邮件对话并能够唯一地标识邮件.我们正在使用Exchange作为MTA.

对于收件箱(以及许多其他文件夹)中的所有邮件,我可以使用邮件标题中的邮件ID进行匹配,但是位于已发送邮件"文件夹中的邮件没有设置邮件ID. /p>

是否可以从这些邮件中获取消息ID?

(我想这些邮件没有标题,因为它们在发送之前已放置在文件夹中;但是在发送邮件之后,MTA会给出一条状态代码为250的消息,其中包含消息ID.)知道还是以某种方式保存MessageID?如果不知道MessageID,Outlook如何跟踪对话? 还有另一种识别邮件的方法吗?

解决方案

首先,让我们澄清一下您为什么说

还有另一种识别邮件的方法

实际上,您可以复制一封电子邮件,它们将具有相同的MessageID,但具有不同的ItemId.如果您有多个收件人:toms@gmail.comtoms@an.exchange.mailbox.comtoms2@an.exchange.mailbox.com,即使第一个甚至不是Exchange,它们也将具有相同的MessageID(又名InternetMessageId).对于另外两个,同一台Exchange服务器中有两条不同的消息. ItemID(又名EntryId).

结论,MessageID从其内容中标识邮件,并由发送电子邮件的邮件服务器进行设置.据我所知,电子邮件的不可变属性别无选择(创建自己的摘要"除外).还请记住,当您将电子邮件从一个文件夹移动到另一个文件夹时,"ItemId"会更改. 请参阅

对于VSTO加载项,您可以使用兑换来检索MessageID aka InternetMessageId . 另一种选择是使用 MAPI

I'm currently writing on an Outlook VSTO AddIn. Using this AddIn, I would like to keep track of E-Mail conversations and be able to uniquely identify mail messages. We are using Exchange as MTA.

For all the mails in the Inbox (and many other folders) I can use the Message ID from the mail's header to do the matching, but mails lying in the "Sent Items" folder do not have a Message ID set.

Is there a way to get the Message IDs from those mails?

(I guess that the mails do not have a header, as they are placed in the folder before being sent; but after sending the mail, the MTA gives a message with status code 250 which contains the Message ID.) Does Outlook know about or somehow save the MessageID? How can Outlook keep track of conversations, if it doesn't know the MessageID? Is there another way to identify a mail?

解决方案

First let us clarify why do you mean by

Is there another way to identify a mail

Actually you can duplicate an email then, they will have the same MessageID but different ItemId. If you have multiple recipients: toms@gmail.com, toms@an.exchange.mailbox.com, toms2@an.exchange.mailbox.com they will have the same MessageID (aka InternetMessageId) even the first one is not even Exchange. For the two others, there are two different messages within the same Exchange server. The have differents ItemID(aka EntryId).

Conclusion, the MessageID identifies the mail from its content and is set by the mailserver sending the email. To my knowledge there is no alternative (except creating your own "digest") from the immutable properties of an email. Keep also in mind that 'ItemId' changes when you move an email from a folder to another. See

For a VSTO add-in you can retrieve the MessageID aka InternetMessageId using Redemption. The other alternative is to ask the ExchangeServer using MAPI or EWS. In all cases there will be a 'server call' and it cannot be retrieve directly after sending because this property is set by Exchange Mail server.

这篇关于在Outlook中获取已发送邮件的MessageID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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