问题描述
所以点击我的应用程序创建Outlook约会提交按钮时,
调用函数SendOutLookAppointment()
我得到这一行appointment.Save()中的错误;
请求失败。远程名称无法解析:服务器名称
公共静态无效SendOutLookAppointment()
{ ExchangeService服务=新ExchangeService(ExchangeVersion.Exchange2010);
service.UseDefaultCredentials = FALSE;
service.Credentials =新的NetworkCredential(admin@test.com,密码);
service.AutodiscoverUrl(admin@test.com); ImpersonatedUserId I =新ImpersonatedUserId(ConnectingIdType.SmtpAddressadmin@test.com);
service.ImpersonatedUserId = I; 预约预约=新的任命(服务);
appointment.Subject =通过WebService的日历预约;
appointment.Body =这是一个测试;
appointment.Start =新日期时间(2014,02,03,21,0,0);
appointment.End =新日期时间(2014,02,02,22,0,0); appointment.RequiredAttendees.Add(me@test.com); appointment.Save();
}
我有一个类似的问题。对我来说,问题是不同的许可。许可:Exchange Online的亭规定:不得通过Exchange Web服务为Kiosk用户邮箱直接访问。
您可以点击这里各种许可证类型之间的差异:
so when clicking the submit button in my application to create appointment on outlookcalling 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();
}
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/
这篇关于交易所API和ASP.NET:the请求失败:远程名称无法解析:"服务器名称和QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!