Message.to property (JavaScript API for Office)

apps for Office

Gets or sets the recipients of an email message.

Last modified: March 04, 2015

Note Note

The name "apps for Office" is changing to "Office Add-ins". During the transition, the documentation and the UI of some Office host applications and Visual Studio tools might still use the term "apps for Office".

Hosts:Outlook

App type: Mail

Available in requirement sets

Mailbox

Last changed in Mailbox

1.1

Applicable Outlook modes

Compose or read

See all support details

Office.context.mailbox.item.to

Compose mode

A Recipients object that you can use to get and set the recipients of a message.

Read mode

A collection that contains an EmailAddressDetails object for each recipient listed on the To line of the message.

In read mode, the to field returns a collection that contains an EmailAddressDetails object for each recipient listed on the To line of the message. The collection is limited to a maximum of 100 members.

New functionality in version 1.1

In compose mode, the to field is a Recipients object that provides the getAsync and setAsync methods to get and set the list of recipients of the message. It also provides the addAsync method so that you can add additional recipients.

In this article, "Outlook" refers to Outlook for Windows, Outlook for Mac, Outlook RT, OWA for Devices (OWA for Android phones, OWA for iPad, OWA for iPhone), and Outlook Web App. "Outlook rich clients" refers to Outlook for Windows, Outlook for Mac and Outlook RT. At this point, Outlook for Mac supports JavaScript API for Office in only Outlook read mode, and can activate mail apps that reference office.js version 1.0 or 1.1 and use apps for Office schema version 1.0.

A checkmark (√) in the following table indicates that this property is supported in the corresponding Outlook host application. An empty cell indicates that the Outlook host application doesn't support this property.

For more information about Office host application and server requirements, see Requirements for running apps for Office.

Supported hosts, by platform

Office for Windows desktop

Office for Windows RT

Office Online
(in browser)

OWA for Devices

Office for Mac

Outlook

√ (Read mode only)

Available in requirement sets

Mailbox

Minimum permission level

ReadItem

App types

Mail

Library

Office.js

Namespace

Office

Version

Changes

1.1

In compose mode, the to field is a Recipients object that provides the getAsync and setAsync methods to get and set the list of recipients of the message. It also provides the addAsync method so that you can add additional recipients.

1.0

Introduced

Show:
© 2015 Microsoft