1

我正在使用 Exchange API 从任何电子邮件地址发送约会请求。下面是我的代码:

ExchangeService exService = new ExchangeService(ExchangeVersion.Exchange2013);
exService.Url = new Uri("exchange URL");
exService.Credentials = new WebCredentials("userID", "password");

Appointment appointment = new Appointment(exService);

appointment.Subject = "Test Subject";
appointment.Body = "test body";
appointment.Location = "Location";
appointment.Start = <Meeting start time>;
appointment.End = <Meeting end time>
appointment.RequiredAttendees.Add("abc@xyz.com");

appointment.Save(SendInvitationsMode.SendOnlyToAll);

此代码运行良好:它向与会者发送邀请电子邮件。

我想知道的是,是否可以直接进入与会者的 Outlook 日历,无需任何邀请电子邮件或与会者的任何批准?

4

2 回答 2

1

不可以,但如果您冒充参加者,则可以代表他们接受邀请。看:

于 2015-07-14T04:10:49.240 回答
0

下面的代码可能会对您有所帮助。

ExchangeService exService = new ExchangeService(ExchangeVersion.Exchange2013);
exService.Url = new Uri("exchange URL");
exService.Credentials = new WebCredentials("userID", "password");

Collection<Appointment> Meetings = new Collection<Appointment>();

Appointment appointment = new Appointment(exService);

appointment.Subject = "Test Subject";
appointment.Body = "test body";
appointment.Location = "Location";
appointment.Start = <Meeting start time>;
appointment.End = <Meeting end time>
appointment.RequiredAttendees.Add("abc@xyz.com");
Meetings.add(appointment)

ServiceResponseCollection<ServiceResponse> responses = service.CreateItems(Meetings,WellKnownFolderName.Calendar,MessageDisposition.SendOnly,SendInvitationsMode.SendToNone);
于 2016-08-04T15:20:52.843 回答