message: send
Article
07/20/2022
2 minutes to read
9 contributors
In this article
Namespace: microsoft.graph
Send an existing draft message.
The draft message can be a new message draft , reply draft , reply-all draft , or a forward draft .
This method saves the message in the Sent Items folder.
Alternatively, send a new message in a single operation.
Permissions
One of the following permissions are 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 /me/messages/{id}/send
POST /users/{id | userPrincipalName}/messages/{id}/send
Name
Type
Description
Authorization
string
Bearer {token}. Required.
Content-Length
number
0. Required.
Request body
Since this method sends an already existing draft message, specifying a request body is not necessary.
Response
If successful, this method returns 202 Accepted response code. It does not return anything in the response body.
Examples
Example 1: Send an existing draft message
The following example shows how to call this API.
Request
Here is an example of the request.
POST https://graph.microsoft.com/v1.0/me/messages/{id}/send
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
await graphClient.Me.Messages["{message-id}"]
.Send()
.Request()
.PostAsync();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
graphClient.me().messages("{id}")
.send()
.buildRequest()
.post();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
graphClient.Me().MessagesById("message-id").Send().Post(context.Background(), nil)
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Import-Module Microsoft.Graph.Users.Actions
# A UPN can also be used as -UserId.
Send-MgUserMessage -UserId $userId -MessageId $messageId
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$graphServiceClient->me()->messagesById('message-id')->send()->post();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation .
Response
Here is an example of the response.
HTTP/1.1 202 Accepted