Mail apps for Outlook and EWS in Exchange
Find information about mail apps for Outlook and how they work with EWS in Exchange.
Last modified: April 03, 2014
Applies to: apps for Office | Exchange Online | Exchange Server 2013 | Office 365 | Outlook 2013 | Outlook Web App | OWA for Devices
Mail apps for Outlook provide a single interface and programming model that uses web standards to enable you to create a custom experience for your email users. You can create mail apps that display contextual or helpful information in a web page hosted in Outlook; for example, a mail app can show a Bing map with an address highlighted when an email message contains an address. Or when a user is composing a message, a mail app can show additional information about the recipient, and insert a standard greeting into the email at the touch of a button.
"Outlook" in this article refers to the Outlook rich client, Outlook Web App, and OWA for Devices.
Recognize entities, like addresses, phone numbers, task suggestions, or meeting suggestions in an email.
Make EWS requests to the Exchange server that hosts the user’s mailbox. A mail app can, for example, get a list of folders so that the user can choose one to store the message, or show all the items in a conversation, or mark an email message as junk.
Get a token to uniquely identify an email account to enable single sign on on a third-party service.
Get a token that enables a third-party service to make EWS requests on behalf of the user, for example, to extract the attachments from an item, or to get an item from the Exchange server for further processing.
You can use mail apps to customize the Outlook Web App experience for your users; if, however, you want to customize the "look and feel" of Outlook Web App, see these articles on TechNet:
Your organization can install mail apps on an internal server to limit access to authorized users, or you and other mail app developers can put mail apps on the Office Store for sale to the general public. Anyone who is running Outlook can download, install, and use mail apps from the marketplace.
You can use a subset of EWS operations on the Exchange server that hosts the account that runs a mail app.
The mailbox.makeEwsRequestAsync function enables you to make EWS requests from your mail app back to the server that hosts the user’s mailbox. You create the SOAP envelope and XML request, and the makeEwsRequestAsync function calls EWS with an authentication token that identifies the mailbox and mail app that is making the request. To help secure the user’s mailbox, the Exchange server will reject any requests that do not come from the mail app or from a mailbox that is not hosted on the server.
Like any other application, a mail app needs permissions to work. Your administrator needs to:
Grant EWS access to the mail apps user.
Set "OAuthAuthentication" to true on the Client Access Server EWS directory.
You also need to make sure that your app requests the read/write mailbox permission in the apps for Office permission model.
When these steps are complete, a subset of folder and item EWS operations are available for the mail app to use.
Service callback tokens
Service callback tokens enable mail apps to pass an access token to a third-party service so that the service can make EWS requests to the Exchange server that hosts the mailbox. For example, a mail app can pass a service callback token to a third-party service along with a list of attachment IDs for pictures attached to an email. The service can then use the attachment IDs and the callback token to make an EWS request to the user’s Exchange server to get the attached pictures. Mail apps can also use the service callback token with a list of item IDs to get email and appointment items from the Exchange server.
The service callback token is an opaque token that the third-party service attaches to the EWS request in a bearer authentication header. The token identifies the mail app and the mailbox to help secure the EWS request. To learn how to use service callback tokens, see the Mail apps for Outlook: Get attachments from an Exchange server sample.