Can i send email in python using delegated permissions from microsoft graph api ?

tapan gupta 1 Reputation point


I am using microsoft graph api to send emails in python but i only have delegated permissions. i am getting errors.

So is it possible to send using delegated permissions or i need application permissions.

Please clear this confusion.

Thank you so much !

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,876 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RajeshKumarMSFT 1,971 Reputation points Microsoft Vendor

    Hi @tapan gupta ,

    Hope you are doing well,

    To send email with Graph API in Python you can use MSAL for Python to achieve the same. You need to provide Application Permissions to Microsoft Graph while registering your application instead of using Delegated permissions and required to provide an Admin Consent to required permissions to make it work.

    In your python code you need to pass account parameter as none like acquire_token_silent(config["scope"], account=None) as you are required to get token for the client and you do not need to provide the redirection URI. Refer

    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