Send mail

Send the message specified in the request body. The message is saved in the Sent Items folder by default.

You can include a file attachment in the same sendMail action call.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Mail.Send
Delegated (personal Microsoft account) Mail.Send
Application Mail.Send

HTTP request

POST /users/{id | userPrincipalName}/sendMail

Request headers

Header Value
Authorization Bearer {token}. Required.
Content-Type application/json

Request body

In the request body, provide a JSON object with the following parameters.

Parameter Type Description
Message Message The message to send. Required.
SaveToSentItems Boolean Indicates whether to save the message in Sent Items. Specify it only if the parameter is false; default is true. Optional.

Response

If successful, this method returns 202, Accepted response code. It does not return anything in the response body.

Example

Here is an example of how to call this API.

Request

Here is an example of the request.

POST https://graph.microsoft.com/v1.0/me/sendMail
Content-type: application/json
Content-length: 512

{
  "message": {
    "subject": "Meet for lunch?",
    "body": {
      "contentType": "Text",
      "content": "The new cafeteria is open."
    },
    "toRecipients": [
      {
        "emailAddress": {
          "address": "fannyd@contoso.onmicrosoft.com"
        }
      }
    ],
    "ccRecipients": [
      {
        "emailAddress": {
          "address": "danas@contoso.onmicrosoft.com"
        }
      }
    ]
  },
  "saveToSentItems": "false"
}
Response

Here is an example of the response.

HTTP/1.1 202 Accepted