When finding items from a Exchange 2010 Server journaling inbox
, there are some notifications on undelivered mails.
When processing these emails and trying to read the DateTimeReceived
property, I get an ServiceObjectPropertyException
with the error:
You must load or assign this property before you can read its value.
Is there a way of identifying such emails, or loading the DateTimeReceived
property (even it will be null)?
My Code is something like this:
FindItemsResults<Item> mails = folder.FindItems(searchConditions, countConstraint);
foreach (Item item in mails)
{
EmailMessage email = (EmailMessage)item;
email.Load();
DateTime receivedTime = email.DateTimeReceived;
....
}
Those emails are from a journaling mailbox that has a copy of monitored mailbox every email sent to it.
The specific emails that do not have this property, are notifications about emails sent from one of those mailboxes, but could not be delivered.
Through MFCMapi I was able to view the message, and the PR_MESSAGE_DELIVERY_TIME
property is set.
I don't think DateTimeReceived
is considered a first class property so you need to load your email with specific properties.
email.Load(new PropertySet(ItemSchema.DateTimeReceived));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With