I am reading a mail using EWS.
Could you please let me know how to filter out only the unread mails from a inbox?
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));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With