1

如何SearchFilter使用 Java EWS 库指定从特定用户获取邮件?

microsoft.exchange.webservices.data.ItemSchema中,我可以找到类似“IsFromMe”的内容,但这将检查当前用户。

提前致谢。

4

1 回答 1

2

From/To 类型信息不在ItemSchema它的 on 上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));    
于 2014-02-15T08:52:10.680 回答