2011-05-24 43 views
5

Exchange 2010 Server journaling inbox中查找项目时,有一些关于未送达邮件的通知。Exchange EWS托管API - 无法确定的邮件通知没有DateTimeReceived属性

在处理这些邮件,并试图读取DateTimeReceived财产,我得到一个ServiceObjectPropertyException出现错误:

You must load or assign this property before you can read its value. 

有识别此类邮件,或加载DateTimeReceived财产的一种方式(即使它会空值)?

我的代码是这样的:

FindItemsResults<Item> mails = folder.FindItems(searchConditions, countConstraint); 
foreach (Item item in mails) 
{ 
    EmailMessage email = (EmailMessage)item; 
    email.Load(); 
    DateTime receivedTime = email.DateTimeReceived; 
    .... 
} 

这些邮件是从已发送给它的每封电子邮件监控邮箱的副本的日记邮箱。

没有此属性的特定电子邮件是关于从其中一个邮箱发送但未能发送的电子邮件的通知。

通过MFCMapi我能够查看消息,并设置了PR_MESSAGE_DELIVERY_TIME属性。

回答

4

我不认为DateTimeReceived被认为是一流的财产,所以你需要加载具有特定属性的电子邮件。

email.Load(new PropertySet(ItemSchema.DateTimeReceived)); 
+0

我试过了,但仍然得到同样的错误。 – Yiftizur 2011-05-25 11:11:50

相关问题