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();
-
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();
-
the error says "you might be missing a using directive".
-
the error says "you might be missing a using directive".
Veni, vidi, caecus
-
the error says "you might be missing a using directive".
-
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();
Make sure you have a reference to the
Microsoft.Exchange.WebServices
assembly, and ausing Microsoft.Exchange.WebServices.Data;
statement at the top of your code file.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer