【发布时间】:2018-07-04 06:02:02
【问题描述】:
我正在使用 EWS Managed API 2.0 发送会议邀请并捕获用户响应。
我已经关注了官网https://msdn.microsoft.com/en-us/library/office/jj220499(v=exchg.80).aspx的参考 和https://msdn.microsoft.com/en-us/library/office/dd633661(v=exchg.80).aspx。我收到一个错误,因为 Id 格式错误。
我已经使用了官方网站上的确切代码。我做了一些谷歌搜索,发现如果 id 具有特殊字符,则可能会出现此错误。但是我提供的 id 没有特殊字符,它只是一个简单的字符。
这里是代码
ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.Credentials = new WebCredentials("********@live.com", "************");
service.TraceEnabled = true;
service.TraceFlags = TraceFlags.All;
service.AutodiscoverUrl("***********@live.com", RedirectionUrlValidationCallback);
// Create the appointment.
Appointment appointment = Appointment.Bind(service, "AAMkA=");
// Set properties on the appointment. Add two required attendees and one optional attendee.
appointment.Subject = "Status Meeting";
appointment.Body = "The purpose of this meeting is to discuss status.";
appointment.Start = new DateTime(2009, 3, 1, 9, 0, 0);
appointment.End = appointment.Start.AddHours(2);
appointment.Location = "Conf Room";
appointment.RequiredAttendees.Add("***********@live.com");
// Send the meeting request to all attendees and save a copy in the Sent Items folder.
appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);
foreach (Attendee t in appointment.RequiredAttendees)
{
if (t.ResponseType != null)
Console.WriteLine("Required attendee - " + t.Address + ": " + t.ResponseType.Value.ToString());
}
@987654326 中出现错误@ID 出现故障。
【问题讨论】:
标签: c# asp.net asp.net-mvc exchange-server exchangewebservices