繁体   English   中英

通过Exchange Web服务移动到另一个文件夹后如何通过ID或GUID访问电子邮件

[英]How to access a email by id or guid after move to another folder via exchange webservices

我有一个公用文件夹结构:

Test\Incoming
Test\Read

我将以下代码与Microsoft.Exchange.WebServices Version 2.2

//Get Email
EmailMessage mailItem = EmailMessage.Bind(service, ItemID, new PropertySet(BasePropertySet.FirstClassProperties));

//Get UniqueId "FirstID"
mailItem.Id.UniqueId

//Move Email to Incoming\Read
mailItem.Move(destinationFolderID);

//After moving the UniqueId changed to "ChangedID"
mailItem.Id.UniqueId

是否可以通过id / guid访问移动的电子邮件,因为UniqueId不是恒定的

它取决于移动的位置,例如,如果您移动到同一邮箱中的另一个文件夹(对于公用文件夹,则可能取决于您在多个邮箱中的位置,而这些文件夹位于不同的邮箱中),则移动方法将返回项目的新ID

//Move Email to Incoming\Read
NewItem = mailItem.Move(destinationFolderID);

//After moving the UniqueId changed to "ChangedID"
NewItem.Id.UniqueId

如果将其移动到另一个邮箱中的文件夹中,则MoveItem操作将不会返回新ID,并且您将需要使用诸如SearchKey或您设置的其他自定义属性在新文件夹中搜索Item

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM