Reputation: 777
I am reading a mail using EWS.
Could you please let me know how to filter out only the unread mails from a inbox?
Upvotes: 3
Views: 3059
Reputation: 10069
Try this code to get the unread mails from inbox
SearchFilter sf = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false));
findResults = service.findItems(WellKnownFolderName.Inbox,sf, new ItemView(20));
Upvotes: 6