Send mail

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

In the same sendMail action call, you can:

Prerequisites

One of the following scopes is required to execute this API: Mail.Send

HTTP request

POST /users/{id | userPrincipalName}/sendMail

Request headers

Header Value
Authorization Bearer . 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.

If you want to use mention to call out another user in the new message:

  • Include the required toRecipients property, the mentions property, and any writable message properties in the request body.
  • For each mention in the mentions property, you must specify the mentioned and createdBy properties.

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 1

Here is an example of the request to create and send a message on the fly.

POST https://graph.microsoft.com/beta/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 1

Here is an example of the response.

HTTP/1.1 202 Accepted
Request 2

The next example includes a mention of another user Dana Swope in the draft.

POST https://graph.microsoft.com/beta/me/sendMail
Content-type: application/json
Content-length: 344

{
  "Message": {
    "subject": "Project kickoff",
    "toRecipients":[
      {
          "emailAddress":{
              "name":"Fanny Downs",
              "address":"fannyd@contoso.onmicrosoft.com"
          }
      }
    ],
    "mentions":[
      {
        "mentioned":{
          "name":"Dana Swope",
          "address":"danas@contoso.onmicrosoft.com"
         },
        "createdBy": {
            "name":"Randi Welch",
            "address":"randiw@contoso.onmicrosoft.com"
        }
      }
    ]
  }
}
Response 2

Here is an example of the response.

HTTP/1.1 202 Accepted