Graph API sends emails but then none is received

Joel Mañas del Barrio 1 Reputation point
2022-08-04T11:10:39.293+00:00

I created a new account from the Microsoft 365 Developer Program with my work email (professional account) to set up a Graph application that sends emails whenever I need from a Java application of my own. For now, what I did was:

  • On the making of my account, I created a new user (it prompted me to do it) with a Microsoft domain (*.onmicrosoft.com) and did the following from this user:
  • Registered a new app from Azure Active Directory (single tenant).
  • Created a client secret (24 months expiration).
  • Granted the necessary permissions:
    ![228064-imagen.png
    Everything until this point seems to be fine, I just did everything the documentation said. But when I try to actually send an email, this happens:
    (example from Postman)
    228079-imagen.png
    Token generated correctly.
    228161-imagen.png
    Email also sent "correctly", but no matter how many times I send it, or how much time I wait, I never see an email pop in my toRecipients' inbox. I tried several times with different emails. Also, I tried the graph-explorer but had no luck either from there. Any ideas?
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,775 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,272 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Andy David - MVP 147.4K Reputation points MVP
    2022-08-04T11:16:35.233+00:00

    You need to be sending through a mail service/system or through Exchange Online if the account is licensed for it:
    https://zimmergren.net/sending-e-mails-using-microsoft-graph-using-dotnet/

    0 comments No comments

  2. Bhanu Kiran 3,606 Reputation points
    2022-08-05T11:34:48.627+00:00

    Hi @Joel Mañas del Barrio ,

    Please check your outlook inbox for any failed delivery mails. This issue is generally observed when you use a trial tenant to send mails using graph API

    This error occurs when sending email from known, low reputation IP addresses that are typically used by new customers on Trail tenants. To fix this issue your Tenant needs to be added to a sending exclusion for 60 days to allow them to use blocked IPs whilst they still have a new/trial license.

    I would suggest you to raise a case with MS Support team from your tenant where you are facing issue, respective team will provide exclusion for your tenant.

    Please look into the post for more information: https://learn.microsoft.com/en-us/answers/questions/951350/index.html

    Hope this helps.

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


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.