如何让所有参与今天与EWS会面的人(电子邮件)?
所以,让我们说我们有这样的意见:
我们如何获得此输出? 1.加入该会议的电子邮件列表
谢谢。
答案 0 :(得分:1)
试试这个。您只能获取与会者信息以及他们是否回复。你找不到谁参加了会议,只有那些打算根据公认的回应加入会议的人。
import { ExchangeService, Uri, WebCredentials, ExchangeVersion, EwsLogging, WellKnownFolderName, CalendarView, DateTime, PropertySet, BasePropertySet, MailboxType, MeetingResponseType } from "ews-javascript-api";
let credentials = require("./credentials");
EwsLogging.DebugLogEnabled = false;
var service = new ExchangeService(ExchangeVersion.Exchange2010);
service.Credentials = new WebCredentials(credentials.userName, credentials.password);
service.Url = new Uri("https://outlook.office365.com/Ews/Exchange.asmx");
new CalendarView(DateTime.Now, DateTime.Now.AddDays(3)));
service.FindAppointments(WellKnownFolderName.Calendar, new CalendarView(DateTime.Now, DateTime.Now.AddDays(3))).then(res => {
if (res.TotalCount > 0) {
let calItem = res.Items[0];
calItem.Load(new PropertySet(BasePropertySet.FirstClassProperties)).then(() => {
// Appointment.Bind(service, new ItemId(itemId), new PropertySet(BasePropertySet.FirstClassProperties)).then(calItem => {
console.log(calItem.Start.toString());
console.log(calItem.End.toString());
console.log(calItem.Subject);
console.log(calItem.Id.UniqueId);
// console.log(calItem.RequiredAttendees);
calItem.RequiredAttendees.GetEnumerator().forEach(x => {
console.log(x.Name + " - " + x.Address + " - " + MailboxType[x.MailboxType] + " - " + MeetingResponseType[x.ResponseType] + " - " + (x.LastResponseTime ? x.LastResponseTime.toString() : null));
});
calItem.OptionalAttendees.GetEnumerator().forEach(x => {
console.log(x.Name + " - " + x.Address + " - " + MailboxType[x.MailboxType] + " - " + MeetingResponseType[x.ResponseType] + " - " + (x.LastResponseTime ? x.LastResponseTime.toString() : null));
});
}, err => {
debugger;
EwsLogging.DebugLog(err, true);
});
}
}, err => {
debugger;
EwsLogging.DebugLog(err, true);
});