Я новичок в EWS, но пытаюсь преобразовать успешно функционирующую IMAP-программу в EWS, и у меня возникают проблемы с доступом к простым полям в управляемом API, например, From, Sender, BodyType. Кто-нибудь может определить, что я делаю не так? Большое спасибо, ребята.
ItemView view = new ItemView(99);
SearchFilter.Exists filter = new SearchFilter.Exists(EmailMessageSchema.Id);
FindItemsResults<Item> inboxMessageList = service.FindItems(WellKnownFolderName.Inbox, view);
Console.WriteLine("Inbox message count: " + inboxMessageList.TotalCount);
int messageCounter = 1;
//message loop
foreach (Item thisMessage in inboxMessageList)
{
//Collect info about current email message
Item thisItem = Item.Bind(service, thisMessage.Id);
Console.WriteLine("Current message ID: " + thisMessage.Id);
string uniqueID = "EMAIL-" + DateTime.UtcNow.ToString("yyyyMMdd-HHmmss-fff");
string messageTo = thisItem.DisplayTo;
string messageCC = thisItem.DisplayCc;
string messageFrom = //cant get this to work
string messageSubject = thisItem.Subject;
string messageDate = thisMessage.DateTimeReceived.ToString();
int noOfAttachments = 0;
Boolean messageHasAttachments = thisMessage.HasAttachments;
if (messageHasAttachments) noOfAttachments = thisMessage.Attachments.Count();
string isBodyHtml = //cant seem to implement this either
Boolean domainblacklistResult = fn.CheckIfDomainBlacklisted(messageFrom);
Boolean emailblacklistResult = fn.CheckIfEmailBlacklisted(messageFrom);