我正在使用 EWS Java API(2.0 版)在 Java 中获取交换电子邮件
我想从交换框获取发送到此电子邮件地址(“rams@mydomain.com”)的所有邮件
这是我的示例代码
String email = "rams@mydomain.com"
ItemView itemView = new ItemView(1000);
SearchFilter.SearchFilterCollection searchFilterCollection1 = new SearchFilter.SearchFilterCollection(
LogicalOperator.Or
);
SearchFilter searchFilter1 = new SearchFilter.ContainsSubstring(EmailMessageSchema.DisplayCc, email);
SearchFilter searchFilter2 = new SearchFilter.ContainsSubstring(EmailMessageSchema.DisplayTo, email);
searchFilterCollection1.add(searchFilter1);
searchFilterCollection1.add(searchFilter2);
FindItemsResults<Item> items = exService.findItems(WellKnownFolderName.SentItems,searchFilterCollection1,itemView);
我没有任何例外。我没有收到任何电子邮件,但实际上电子邮件存在于服务器中。
谢谢