Error in sending mail using graph API's

Atharva Diwan 10 Reputation points
2023-06-05T09:52:45.5966667+00:00

Screenshot 2023-06-05 130243

I was getting this error for Send mail, forward mail, reply, reply all endpoints. Can anyone tell me why recipient email provider rejecting emails.

I am using email address of gmail and outlook. I tried using dummy (temporary) emails also but getting same result.

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. msft-gu 1,355 Reputation points
    2023-06-05T18:37:48.0166667+00:00

    Hi Atharva Diwan,

    Good afternoon and thank you for your question. First, please remove the email address on the screenshot that you have provided since it is PII.

    I tested /me/sendMail on my environment and I was able to send emails to my M365 account to another M365 account, Outlook Live and GMail with 202 code. It is highly possible that the issue that you have is bound only to the recipient or recipient's organization.

    Here are next steps that you can do:

    • Reach out to the recipient and verify if they have any transport rules or inbox rules.
    • Create a ticket with Microsoft 365 Support to assist you on getting message trace (or extended message trace) to investigate why the email has been rejected.

    I hope this helps. If I answered your question, please Upvote it and accept it as an answer.

    0 comments No comments

  2. Atharva Diwan 10 Reputation points
    2023-06-06T05:08:50.3066667+00:00

    I have tried sending mail from UI and it is delivered successfully. So I am expecting that the API should also work the same way. Even I am getting 202 status code from API. Only the mail is getting rejected by receiver.

    Mail is delivered when sent by UI but not by API. Not able to figure out issue.


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.