如何使用 ews-javascript-api 从 EWS 获取参加会议的电子邮件列表?
How to get list of emails who took part in a meeting from EWS using ews-javascript-api?
如何获取参加今天 EWS 会议的所有人(电子邮件)?
假设我们有这样的输入:
- email/password MS Exchange 帐户
- 时间范围:1 天
- 会议:会议 ID 或名称
我们怎样才能得到这个输出?
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);
});
如何获取参加今天 EWS 会议的所有人(电子邮件)?
假设我们有这样的输入:
- email/password MS Exchange 帐户
- 时间范围:1 天
- 会议:会议 ID 或名称
我们怎样才能得到这个输出? 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);
});