Skip to content

Instantly share code, notes, and snippets.

@VibhuKuchhal
Last active April 19, 2016 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VibhuKuchhal/0a5ca2173ff6a45c11d2 to your computer and use it in GitHub Desktop.
Save VibhuKuchhal/0a5ca2173ff6a45c11d2 to your computer and use it in GitHub Desktop.
var items = serviceInstance.FindItems(
//Find Mails from Inbox of the given Mailbox
new FolderId(WellKnownFolderName.Inbox, new Mailbox(ConfigurationManager.AppSettings["MailBox"].ToString())),
//Filter criterion
new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter[] {
new SearchFilter.ContainsSubstring(ItemSchema.Subject, ConfigurationManager.AppSettings["ValidEmailIdentifier"].ToString()),
new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false)
}),
//View Size as 15
new ItemView(15));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment