Office.EmailAddressDetails interface

提供电子邮件或约会的发件人或指定收件人的电子邮件属性。

注解

最低权限级别读取项

适用的 Outlook 模式:撰写或阅读

属性

appointmentResponse

获取参与者返回的约会响应。 此属性仅适用于约会的参与者,由 optionalAttendeesrequiredAttendees 属性表示。 此属性在其他方案中返回未定义。

displayName

获取与电子邮件地址关联的显示名称。

emailAddress

获取 SMTP 电子邮件地址。

recipientType

获取收件人的电子邮件地址类型。

属性详细信息

appointmentResponse

获取参与者返回的约会响应。 此属性仅适用于约会的参与者,由 optionalAttendeesrequiredAttendees 属性表示。 此属性在其他方案中返回未定义。

appointmentResponse: MailboxEnums.ResponseType | string;

属性值

示例

// The following sample provides the responses from required attendees.
// Note that this sample needs the add-in to be in Appointment Read (Attendee) mode.
const requiredAttendees = Office.context.mailbox.item.requiredAttendees;
console.log("There are " + requiredAttendees.length + " required attendees.")
requiredAttendees.forEach(function (requiredAttendee) {
    console.log("Attendee " + requiredAttendee.displayName + ": " + requiredAttendee.appointmentResponse);
});

displayName

获取与电子邮件地址关联的显示名称。

displayName: string;

属性值

string

示例

const organizerName = Office.context.mailbox.item.organizer.displayName;
console.log("Organizer: " + organizerName);

emailAddress

获取 SMTP 电子邮件地址。

emailAddress: string;

属性值

string

示例

const organizerAddress = Office.context.mailbox.item.organizer.emailAddress;
console.log("Organizer's email address: " + organizerAddress);

recipientType

获取收件人的电子邮件地址类型。

recipientType: MailboxEnums.RecipientType | string;

属性值

注解

重要说明recipientType 属性值不会由 Office.context.mailbox.item.from.getAsyncOffice.context.mailbox.item.organizer.getAsync 方法返回。 电子邮件发件人或约会组织者始终是电子邮件地址位于 Exchange 服务器上的用户。

示例

const requiredAttendees = Office.context.mailbox.item.requiredAttendees;
console.log("There are " + requiredAttendees.length + " required attendees.")
requiredAttendees.forEach(function (requiredAttendee) {
    console.log("Attendee " + requiredAttendee.displayName + ": " + requiredAttendee.recipientType);
});