I am trying to send an automated email from the company's exchange server, but it doesn't recognize the "ExchangeService " and "EmailMessage" in the following C# code
This is my code. Please help.
string from = "myemail@myexchangeserver.com";
string to = "recipient@email.com";
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);//error here
service.AutodiscoverUrl(from);
EmailMessage message = new EmailMessage(service);// Error here
message.Subject = "Email Subject";
message.Body = richTextBox1.Text;
message.ToRecipients.Add(to);
message.Save();
message.SendAndSaveCopy();