簡體   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