Get the MailTips of one or more recipients as available to the signed-in user.
Note that by making a POST call to the getMailTips action, you can request specific types of MailTips to
be returned for more than one recipient at one time. The requested MailTips are returned in a mailTips collection.
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.Read
Mail.Read.Shared
Delegated (personal Microsoft account)
Mail.Read
Not available.
Application
Mail.Read
Not available.
HTTP request
POST /me/getMailTips
POST /users/{id|userPrincipalName}/getMailTips
In the request body, provide a JSON object with the following parameters.
Property
Type
Description
EmailAddresses
String collection
A collection of SMTP addresses of recipients to get MailTips for.
MailTipsOptions
String
A enumeration of flags that represents the requested mailtips. Possible values are: automaticReplies, customMailTip, deliveryRestriction, externalMemberCount, mailboxFullStatus, maxMessageSize, moderationStatus, recipientScope, recipientSuggestions, and totalMemberCount.
Response
If successful, this method returns a 200 OK response code and a collection of mailTips objects in the response body.
Example
Request
The following example gets MailTips for the specified recipients, for any automatic reply settings and the mailbox full status.
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Me.GetMailTips;
using Microsoft.Graph.Models;
var requestBody = new GetMailTipsPostRequestBody
{
EmailAddresses = new List<string>
{
"danas@contoso.com",
"fannyd@contoso.com",
},
MailTipsOptions = MailTipsType.AutomaticReplies | MailTipsType.MailboxFullStatus,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.GetMailTips.PostAsGetMailTipsPostResponseAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphusers "github.com/microsoftgraph/msgraph-sdk-go/users"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphusers.NewItemGetMailTipsPostRequestBody()
emailAddresses := []string {
"danas@contoso.com",
"fannyd@contoso.com",
}
requestBody.SetEmailAddresses(emailAddresses)
mailTipsOptions := graphmodels.AUTOMATICREPLIES, MAILBOXFULLSTATUS_MAILTIPSTYPE
requestBody.SetMailTipsOptions(&mailTipsOptions)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
getMailTips, err := graphClient.Me().GetMailTips().PostAsGetMailTipsPostResponse(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.users.item.getmailtips.GetMailTipsPostRequestBody getMailTipsPostRequestBody = new com.microsoft.graph.users.item.getmailtips.GetMailTipsPostRequestBody();
LinkedList<String> emailAddresses = new LinkedList<String>();
emailAddresses.add("danas@contoso.com");
emailAddresses.add("fannyd@contoso.com");
getMailTipsPostRequestBody.setEmailAddresses(emailAddresses);
getMailTipsPostRequestBody.setMailTipsOptions(EnumSet.of(MailTipsType.AutomaticReplies, MailTipsType.MailboxFullStatus));
var result = graphClient.me().getMailTips().post(getMailTipsPostRequestBody);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Users\Item\GetMailTips\GetMailTipsPostRequestBody;
use Microsoft\Graph\Generated\Models\MailTipsType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new GetMailTipsPostRequestBody();
$requestBody->setEmailAddresses(['danas@contoso.com', 'fannyd@contoso.com', ]);
$requestBody->setMailTipsOptions(new MailTipsType('automaticReplies, mailboxFullStatus'));
$result = $graphServiceClient->me()->getMailTips()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Users.Actions
$params = @{
EmailAddresses = @(
"danas@contoso.com"
"fannyd@contoso.com"
)
MailTipsOptions = "automaticReplies, mailboxFullStatus"
}
# A UPN can also be used as -UserId.
Get-MgUserMailTip -UserId $userId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.users.item.get_mail_tips.get_mail_tips_post_request_body import GetMailTipsPostRequestBody
from msgraph.generated.models.mail_tips_type import MailTipsType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = GetMailTipsPostRequestBody(
email_addresses = [
"danas@contoso.com",
"fannyd@contoso.com",
],
mail_tips_options = MailTipsType.AutomaticReplies | MailTipsType.MailboxFullStatus,
)
result = await graph_client.me.get_mail_tips.post(request_body)