如何使用Java EWS库指定SearchFilter
以从特定用户获取邮件?
在microsoft.exchange.webservices.data.ItemSchema
中,我可以找到类似“IsFromMe”的内容,但这会检查当前用户。
提前致谢。
答案 0 :(得分:2)
发件人/收件人类型信息不在ItemSchema
EmailMessageSchema
上。电话会看起来像这样:
ExchangeService service = new ExchangeService();
//login to your exchange server with credentials etc & set your service url
.....
//issue your search for a given user using EmailMesssageSchema.From
FindItemsResults <Item> results = service.findItems(WellKnownFolderName.Inbox,
new SearchFilter.IsEqualTo(EmailMessageSchema.From, "SomeUser"), new ItemView(100));