Office.EmailAddressDetails interface

Provides the email properties of the sender or specified recipients of an email message or appointment.

Remarks

Minimum permission level: read item

Applicable Outlook mode: Compose or Read

Properties

appointmentResponse

Gets the response that an attendee returned for an appointment. This property applies to only an attendee of an appointment, as represented by the optionalAttendees or requiredAttendees property. This property returns undefined in other scenarios.

displayName

Gets the display name associated with an email address.

emailAddress

Gets the SMTP email address.

recipientType

Gets the email address type of a recipient.

Property Details

appointmentResponse

Gets the response that an attendee returned for an appointment. This property applies to only an attendee of an appointment, as represented by the optionalAttendees or requiredAttendees property. This property returns undefined in other scenarios.

appointmentResponse: MailboxEnums.ResponseType | string;

Property Value

Examples

// 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

Gets the display name associated with an email address.

displayName: string;

Property Value

string

Examples

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

emailAddress

Gets the SMTP email address.

emailAddress: string;

Property Value

string

Examples

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

recipientType

Gets the email address type of a recipient.

recipientType: MailboxEnums.RecipientType | string;

Property Value

Remarks

Important:

  • A recipientType property value isn't returned by the Office.context.mailbox.item.from.getAsync and Office.context.mailbox.item.organizer.getAsync methods. The email sender or appointment organizer is always a user whose email address is on the Exchange server.

  • While composing a mail item, when you switch to a sender account that's on a different domain than that of the previously selected sender account, the value of the recipientType property for existing recipients isn't updated and will still be based on the domain of the previously selected account. To get the correct recipient types after switching accounts, you must first remove the existing recipients, then add them back to the mail item.

Examples

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);
});