我正在尝试使用Microsoft Exchange(EWS)API从房间共享日历中获取会议列表,并且它返回此错误:没有带有此类guid的邮箱
var service = new ExchangeService();
service.Credentials = new NetworkCredential("username", "password");
service.Url = new Uri("exchangeUrl");
var startDate = DateTime.Today;
var endDate = DateTime.Today.AddDays(1);
var cv = new CalendarView(startDate, endDate);
var mailboxToAccess = "room_email_address@mycompany.com";
var calendarFolderId = new FolderId(WellKnownFolderName.Calendar, mailboxToAccess);
var appointments = service.FindAppointments(calendarFolderId, cv); // << Exception happens here
任何想法可能出错?
答案 0 :(得分:0)
确保您使用的用户
service.Credentials = new NetworkCredential(&#34; username&#34;,&#34; password&#34;);
具有自己邮箱的许可用户是否已被授予对相关共享邮箱的访问权限。
答案 1 :(得分:0)
如果要从应用程序端访问Outlook邮箱,请使用此功能。
语言:C#
service.Credentials = new NetworkCredential("username", "password");
service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");