I am getting an error when trying to retrieve an Email using Exchange Web Services.
I am getting a list of emails available with this;
var messageInfoList = mailBoxMonitor.ExchangeWS.GetMessageList(new EwsFolderId(mailBoxMonitor.MailBoxSettings.Folder), EwsListFields.All, offset, chunkSize);
Then iterating through that list to retrieve each email with;
foreach (EwsMessageInfo thisMessageInfo in messageInfoList)
{
MailMessage thisMessage = mailBoxMonitor.ExchangeWS.GetMailMessage(thisMessageInfo.ItemId);
}
But the GetMailMessage call is returning ErrorInvalidIdMalformed even though I'm simply passing on the ItemId returned from the list. It doesn't always do this, only for certain emails.
What am I doing wrong?