Exchange API and ASP.NET:the request failed:the remote name could not be resolved:“server name”

做~自己de王妃 提交于 2019-12-11 07:05:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!