此代码有效,只是 From 属性返回为空白。再多的使用 PropertySets 似乎都无法解决它。有人知道我在做什么错吗?
Folder inbox = Folder.Bind(service, WellKnownFolderName.Inbox);
SearchFilter.SearchFilterCollection sfc = new SearchFilter.SearchFilterCollection(LogicalOperator.Or);
sfc.Add(new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, true));
ItemView view = new ItemView(1000);
view.PropertySet = new PropertySet(BasePropertySet.FirstClassProperties);
FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox, sfc, view);
foreach (EmailMessage i in findResults)
{
Console.WriteLine("Received: " + i.DateTimeReceived.ToString() + " From: " + i.From + " Subject: " + i.Subject);
}