Sending Mail Via Using Graph API Is So Slow & Uncertainty

GAM 1 Reputation point
2022-06-16T08:45:32.85+00:00

Hello,

I'm using Microsoft Graph API for sending E-Mails to someone why I used this method is Basic Authentication will be removed on 1 October.

But I encountered some problems which is sending email is so slow or does not exactly reach Inbox accurately.

Sometimes, I POST a Request then E-Mail is firing instantly then I thank Microsoft servers :)
But generally (not sometimes) when I POST a request to send a E-Mail, anything does not reach Inbox's even 5 min later.

So I cannot trust this API for uncertainty. Any help appreciated thanks a lot.

NOTE: I'm using this with license which is Azure Developer Program

I am using this cURL request for getting AccessToken:

curl --location --request POST 'https://login.microsoftonline.com/**TENANT_ID**/oauth2/v2.0/token' \  
--header 'Content-Type: application/x-www-form-urlencoded' \  
--data-urlencode 'grant_type=client_credentials' \  
--data-urlencode 'client_id=**CLIENT_ID**' \  
--data-urlencode 'client_secret=**CLIENT_SECRET**' \  
--data-urlencode 'scope=https://graph.microsoft.com/.default'  

I am using this cURL request for sending a mail:

curl --location --request POST 'https://graph.microsoft.com/v1.0/users/**USER_ID**/sendMail' \  
--header 'Authorization: Bearer **ACCESS_TOKEN**' \  
--header 'Content-Type: application/json' \  
--data-raw '{  
    "message": {  
        "subject": "Meet for lunch?",  
        "body": {  
            "contentType": "Text",  
            "content": "The new cafeteria is open."  
        },  
        "toRecipients": [  
            {  
                "emailAddress": {  
                    "address": "test@gmail.com",  
                    "name": "FOOO"  
                }  
            }  
        ]  
    }  
}'
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,870 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RajeshKumarMSFT 1,971 Reputation points Microsoft Vendor
    2022-06-22T14:58:54.953+00:00

    Hi @GAM ,

    As this issue seems to be occurring for a specific tenant ,I would recommend you to raise a support case with Microsoft Graph, a Support Engineer wiould be able to assist you better by analyzing the logs . You can raise support ticket from http://aad.portal.azure.com/ or https://admin.microsoft.com/#/support/requests.

    Hope this helps.
    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

  2. Bryan 1 Reputation point
    2022-09-07T11:22:02.883+00:00

    Hello,

    I have the same problem, also when sending attached documents and the email takes 14 minutes to arrive.

    Kind regards.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.