Can't send email using Graph API

Osema MEKELLECHE 0 Reputation points
2025-02-08T08:17:52.62+00:00

I can't send email with Graph API whether using application or delegated permission

The account used is personl

When trying with Graph Explorer it succeeds, but failure occurs when using Postman

The response code is always 401

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

2 answers

Sort by: Most helpful
  1. Saranya Madhu-MSFT 2,375 Reputation points Microsoft External Staff
    2025-02-10T02:24:57.7433333+00:00

    Hi Osema MEKELLECHE,

    Thanks for reaching out to Microsoft!

    401 error indicates that the access token is either missing, invalid, or expired.

    As mentioned in the document, make sure that your application is presenting a valid access token to Microsoft Graph as part of the request. We strongly recommend that you use the Microsoft Authentication Library (MSAL) for access token acquisition.

    Decode token, scp (scope) or roles: Should include the permissions your app needs, like "Mail.Send". 

    Hope this helps.

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

    0 comments No comments

  2. CarlZhao-MSFT 46,406 Reputation points
    2025-02-10T02:38:36.76+00:00

    Hi @Osema MEKELLECHE

    Personal accounts do not support application permissions, only delegated permissions. In addition, you need to make sure your application has been configured to allow personal accounts to log in.

    User's image

    Then, use the auth code flow to perform authentication for the personal account, and change /{tenant_id} to /common.

    "https://login.microsoftonline.com/common/oauth2/v2.0/authorize"

    "https://login.microsoftonline.com/common/oauth2/v2.0/token"


    Hope this helps.

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

    0 comments No comments

Your answer

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