I want to send a reply email. I found this example in microsoft examples on using EWS. The problem is I get this error when running this piece of code.
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
EmailMessage mes = new EmailMessage(service);
string replyto = mes.Sender.Address;
Console.WriteLine(replyto);
mes.Subject = "Notification Received";
mes.Body = "Your notification has successfully been added to the site";
mes.ToRecipients.Add(replyto);
mes.Send();
Error: Error: You must load or assign this property before you can read its value.
mes.Sender.Addresshas not been assigned – you cannot read a property until you assign it a value. SeeEmailMessage.Senderon MSDN for reference.