APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Forward a message using either JSON or MIME format.
When using JSON format, you can:
Specify either a comment or the body property of the message parameter. Specifying both will return an HTTP 400 Bad Request error.
Specify either the toRecipients parameter or the toRecipients property of the message parameter. Specifying both or specifying neither will return an HTTP 400 Bad Request error.
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type
Least privileged permissions
Higher privileged permissions
Delegated (work or school account)
Mail.Send
Not available.
Delegated (personal Microsoft account)
Mail.Send
Not available.
Application
Mail.Send
Not available.
HTTP request
POST /me/messages/{id}/forward
POST /users/{id | userPrincipalName}/messages/{id}/forward
POST /me/mailFolders/{id}/messages/{id}/forward
POST /users/{id | userPrincipalName}/mailFolders/{id}/messages/{id}/forward
Any writeable properties to update in the reply message.
When specifying the body in MIME format, provide the MIME content with the applicable Internet message headers ("To", "CC", "BCC", "Subject"), all encoded in base64 format in the request body.
Response
If successful, this method returns 202 Accepted response code. It doesn't return anything in the response body.
If the request body includes malformed MIME content, this method returns 400 Bad request and the following error message: "Invalid base64 string for MIME content".
Examples
Example 1: Forward a message using JSON format
The following example sets the isDeliveryReceiptRequested property to true, adds a comment and forwards the message.
POST https://graph.microsoft.com/beta/me/messages/AAMkADA1MTAAAH5JaLAAA=/forward
Content-Type: application/json
{
"message":{
"isDeliveryReceiptRequested": true,
"toRecipients":[
{
"emailAddress": {
"address":"danas@contoso.com",
"name":"Dana Swope"
}
}
]
},
"comment": "Dana, just want to make sure you get this."
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Me.Messages.Item.Forward;
using Microsoft.Graph.Beta.Models;
var requestBody = new ForwardPostRequestBody
{
Message = new Message
{
IsDeliveryReceiptRequested = true,
ToRecipients = new List<Recipient>
{
new Recipient
{
EmailAddress = new EmailAddress
{
Address = "danas@contoso.com",
Name = "Dana Swope",
},
},
},
},
Comment = "Dana, just want to make sure you get this.",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Me.Messages["{message-id}"].Forward.PostAsync(requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
mgc-beta users messages forward post --user-id {user-id} --message-id {message-id} --body '{\
"message":{\
"isDeliveryReceiptRequested": true,\
"toRecipients":[\
{\
"emailAddress": {\
"address":"danas@contoso.com",\
"name":"Dana Swope"\
}\
}\
]\
},\
"comment": "Dana, just want to make sure you get this."\
}\
'
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphusers "github.com/microsoftgraph/msgraph-beta-sdk-go/users"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphusers.NewItemForwardPostRequestBody()
message := graphmodels.NewMessage()
isDeliveryReceiptRequested := true
message.SetIsDeliveryReceiptRequested(&isDeliveryReceiptRequested)
recipient := graphmodels.NewRecipient()
emailAddress := graphmodels.NewEmailAddress()
address := "danas@contoso.com"
emailAddress.SetAddress(&address)
name := "Dana Swope"
emailAddress.SetName(&name)
recipient.SetEmailAddress(emailAddress)
toRecipients := []graphmodels.Recipientable {
recipient,
}
message.SetToRecipients(toRecipients)
requestBody.SetMessage(message)
comment := "Dana, just want to make sure you get this."
requestBody.SetComment(&comment)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Me().Messages().ByMessageId("message-id").Forward().Post(context.Background(), requestBody, nil)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.users.item.messages.item.forward.ForwardPostRequestBody forwardPostRequestBody = new com.microsoft.graph.beta.users.item.messages.item.forward.ForwardPostRequestBody();
Message message = new Message();
message.setIsDeliveryReceiptRequested(true);
LinkedList<Recipient> toRecipients = new LinkedList<Recipient>();
Recipient recipient = new Recipient();
EmailAddress emailAddress = new EmailAddress();
emailAddress.setAddress("danas@contoso.com");
emailAddress.setName("Dana Swope");
recipient.setEmailAddress(emailAddress);
toRecipients.add(recipient);
message.setToRecipients(toRecipients);
forwardPostRequestBody.setMessage(message);
forwardPostRequestBody.setComment("Dana, just want to make sure you get this.");
graphClient.me().messages().byMessageId("{message-id}").forward().post(forwardPostRequestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
const options = {
authProvider,
};
const client = Client.init(options);
const forward = {
message: {
isDeliveryReceiptRequested: true,
toRecipients: [
{
emailAddress: {
address: 'danas@contoso.com',
name: 'Dana Swope'
}
}
]
},
comment: 'Dana, just want to make sure you get this.'
};
await client.api('/me/messages/AAMkADA1MTAAAH5JaLAAA=/forward')
.version('beta')
.post(forward);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Users\Item\Messages\Item\Forward\ForwardPostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\Message;
use Microsoft\Graph\Beta\Generated\Models\Recipient;
use Microsoft\Graph\Beta\Generated\Models\EmailAddress;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ForwardPostRequestBody();
$message = new Message();
$message->setIsDeliveryReceiptRequested(true);
$toRecipientsRecipient1 = new Recipient();
$toRecipientsRecipient1EmailAddress = new EmailAddress();
$toRecipientsRecipient1EmailAddress->setAddress('danas@contoso.com');
$toRecipientsRecipient1EmailAddress->setName('Dana Swope');
$toRecipientsRecipient1->setEmailAddress($toRecipientsRecipient1EmailAddress);
$toRecipientsArray []= $toRecipientsRecipient1;
$message->setToRecipients($toRecipientsArray);
$requestBody->setMessage($message);
$requestBody->setComment('Dana, just want to make sure you get this.');
$graphServiceClient->me()->messages()->byMessageId('message-id')->forward()->post($requestBody)->wait();
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Import-Module Microsoft.Graph.Beta.Users.Actions
$params = @{
message = @{
isDeliveryReceiptRequested = $true
toRecipients = @(
@{
emailAddress = @{
address = "danas@contoso.com"
name = "Dana Swope"
}
}
)
}
comment = "Dana, just want to make sure you get this."
}
# A UPN can also be used as -UserId.
Invoke-MgBetaForwardUserMessage -UserId $userId -MessageId $messageId -BodyParameter $params
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.users.item.messages.item.forward.forward_post_request_body import ForwardPostRequestBody
from msgraph_beta.generated.models.message import Message
from msgraph_beta.generated.models.recipient import Recipient
from msgraph_beta.generated.models.email_address import EmailAddress
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ForwardPostRequestBody(
message = Message(
is_delivery_receipt_requested = True,
to_recipients = [
Recipient(
email_address = EmailAddress(
address = "danas@contoso.com",
name = "Dana Swope",
),
),
],
),
comment = "Dana, just want to make sure you get this.",
)
await graph_client.me.messages.by_message_id('message-id').forward.post(request_body)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
POST https://graph.microsoft.com/beta/me/messages/AAMkADA1MTAAAH5JaLAAA=/forward
Content-Type: text/plain
Q29udGVudC1UeXBlOiBhcHBsaWNhdGlvbi9wa2NzNy1taW1lOw0KCW5hbWU9c21pbWUucDdtOw0KCXNtaW1lLXR5cGU9ZW52ZWxvcGVkLWRhdGENCk1pbWUtVmVyc2lvbjogMS4wIChNYWMgT1MgWCBNYWlsIDEzLjAgXCgzNjAxLjAuMTBcKSkNClN1YmplY3Q6IFJlOiBUZXN0aW5nIFMvTUlNRQ0KQ29udGVudC1EaXNwb3Np...
Response
The following example shows the response.
HTTP/1.1 202 Accepted
If the request body includes malformed MIME content, this method returns the following error message.
HTTP/1.1 400 Bad Request
Content-type: application/json
{
"error": {
"code": "ErrorMimeContentInvalidBase64String",
"message": "Invalid base64 string for MIME content."
}
}