I’m working on an application that must read the email content and move emails from one folder to another, these are the only two features that it must support. The mail server is Exchange 2010 and I have enough privileges to access the mailbox.
I’ve been seeing some posts about EWS Managed Code but I’m certainly lost in all this information. Can you shed some light on this and advise about the best approach to accomplish it?
Ps. Using VS 2015 and .net framework 4.5
Update: find below a quick test using the EWS Manage API
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
//This will accept all certificates, regardless of why they are invalid
ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
service.Credentials = new WebCredentials("Administrator", "mypassword", "myexchangeserver.com");
service.Url = new Uri("https://myexchangeserver.com/EWS/Exchange.asmx");
EmailMessage email = new EmailMessage(service);
email.ToRecipients.Add("userid@myexchangeserver.com");
email.Subject = String.Format("HelloWorld at {0}", DateTime.Now);
email.Body = new MessageBody("This is the first email I've sent by using the EWS Managed API.");
email.Send();