问题
so when clicking the submit button in my application to create appointment on outlook calling the function SendOutLookAppointment() i get the error on this line appointment.Save(); The request failed. The remote name could not be resolved:'servername'
public static void SendOutLookAppointment()
{
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010);
service.UseDefaultCredentials = false;
service.Credentials = new NetworkCredential("admin@test.com.", "password");
service.AutodiscoverUrl("admin@test.com");
ImpersonatedUserId i = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "admin@test.com");
service.ImpersonatedUserId = i;
Appointment appointment = new Appointment(service);
appointment.Subject = "Calendar booking via WebService";
appointment.Body = "this is a test";
appointment.Start = new DateTime(2014, 02, 03, 21, 0, 0);
appointment.End = new DateTime(2014, 02, 02, 22, 0, 0);
appointment.RequiredAttendees.Add("me@test.com");
appointment.Save();
}
回答1:
I had a similar issue. In my case, the problem was different licenses. License: "Exchange Online Kiosk" specifies: "Direct access to Kiosk user mailboxes via Exchange Web Services is not permitted." You can check differences between various license types here: http://www.office365advisors.com/exchange-licensing/
来源:https://stackoverflow.com/questions/21462278/exchange-api-and-asp-netthe-request-failedthe-remote-name-could-not-be-resolve