Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Exchange EWS托管API-无法删除的邮件通知没有DateTimeReceived属性_C#_Exchangewebservices - Fatal编程技术网

C# Exchange EWS托管API-无法删除的邮件通知没有DateTimeReceived属性

C# Exchange EWS托管API-无法删除的邮件通知没有DateTimeReceived属性,c#,exchangewebservices,C#,Exchangewebservices,从Exchange2010服务器日志收件箱中查找项目时,会收到一些关于未送达邮件的通知 在处理这些电子邮件并尝试读取DateTimeReceived属性时,我得到了一个ServiceObjectPropertyException,错误如下: You must load or assign this property before you can read its value. 是否有办法识别此类电子邮件,或加载DateTimeReceived属性(即使该属性为空) 我的代码是这样的: Find

Exchange2010服务器日志收件箱
中查找项目时,会收到一些关于未送达邮件的通知

在处理这些电子邮件并尝试读取
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;
  ....
}
FindItemsResults mails=folder.FindItems(searchConditions,countConstraint);
foreach(邮件中的项目)
{
EmailMessage email=(EmailMessage)项;
email.Load();
DateTime receivedTime=email.DateTimeReceived;
....
}
这些电子邮件来自一个日志邮箱,该邮箱包含发送到它的每封电子邮件的一个受监控邮箱的副本

不具有此属性的特定电子邮件是关于从其中一个邮箱发送但无法传递的电子邮件的通知


通过MFCMapi,我可以查看邮件,并且设置了
PR\u message\u DELIVERY\u TIME
属性。

我认为
DateTimeReceived
不被视为一级属性,因此您需要使用特定属性加载电子邮件

email.Load(new PropertySet(ItemSchema.DateTimeReceived));
请尝试
((MailItem)项)。DateTimeReceived
-有关参考信息,请参阅