Update: This has been fixed in the latest release.
From EWS protocol's point-of-view, the message's MessageId is just one of the message headers, so if you need to access a message with a particular MessageId, you have to search for it, for example like this:
var searchResult = await _exchange.SearchAsync(EwsFolderId.Inbox, EwsItemFields.Id, EwsSearchParameter.MessageId(messageId));
if (searchResult.Count == 1)
{
var ewsItemId = searchResult[0].Id;
EwsMessageInfo ewsMessage = await ewsClient.GetMessageInfoAsync(item.messageId, EwsItemFields.Full);
}
else
{
// there is no message with the specified MessageId, or there are more than one
...
}
As for MessageId
being null
in GetMessageList
result (even when EwsItemFields.Envelope is specified) - this seems to be a bug, and we will fix it for the next release as well. Looks like someone confused this ID with the EWS item ID. Strangely, no one noticed until now.