sendMail api gives 202 response but not able to send mail in micro soft graph api

Dhage, Endraja (CIB Tech, IND) 0 Reputation points
2023-04-28T12:43:11.3466667+00:00

Hi ,

I am trying send and read mail from shared mailbox using microosft graph api in python.

I am able to generate token using MSL library : https://kontext.tech/article/795/python-send-email-via-microsoft-graph-api

after token generation i am trying to send mail using sendMail api :

https://graph.microsoft.com/v1.0/users/{User Id}/sendMail

In response i am getting 202 status code.

but mail is not getting send.

Please help me

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,503 questions
Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
556 questions
{count} votes

1 answer

Sort by: Most helpful
  1. TH-4749-MSFT 3,305 Reputation points
    2023-04-28T16:13:34.83+00:00

    Hi Dhage, Endraja (CIB Tech, IND),

    Thanks for reaching out. Please check if the message was not blocked on the recipient end. Also check the Sent Items folder of the sender mailbox to see if it contains the sent message or if an NDR was received in the Inbox. I was able to test the graph api call and response body mentioned in the article you provided via Graph Explorer (aka.ms/ge) with message successfully delivered to recipient mailbox.

    Thanks.

    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.