diff --git a/README.md b/README.md index 0a4c235..dc8d567 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ The EWS Toolkit is a .NET Framework Library that wraps around the EWS Managed AP ## Example +Auth and send email ``` using Toolkit; @@ -13,6 +14,8 @@ namespace DemoApp { static void Main(string[] args) { + //Program.exe random@example.org Passw0rd123 + var connection = new ExchangeConnection(ExchangeVersion.Exchange2013_SP1); connection.SetConnectionCredentials(args[0], args[1].ToSecureString()); connection.SetAutodiscoverUrl(args[0]); @@ -25,4 +28,37 @@ namespace DemoApp } } } -``` \ No newline at end of file +``` + +Auth and search for keywords in the inbox and sent folders +``` +using Toolkit; + +namespace DemoApp +{ + class Program + { + static void Main(string[] args) + { + + //Program.exe random@example.org Passw0rd123 + + ExchangeConnection connection = new ExchangeConnection(ExchangeVersion.Exchange2013_SP1); + connection.SetConnectionCredentials(args[0], args[1].ToSecureString()); + connection.SetAutodiscoverUrl(args[0]); + + Search searchData = new Search(connection); + + //Add single search terms + searchData.AddBodySearchTerm("Administrator"); + searchData.AddSubjectSearchTerm("Support"); + + //Add multi search terms + searchData.AddBodySearchTerms(new string[] { "Password", "Login" }); + searchData.AddSubjectSearchTerms(new string[] { "Onboarding", "Welcome" }); + + List searchResult = searchData.SearchFolder(FolderName.Inbox | FolderName.SentItems); + } + } +} +```