Send an email to given user from the registered Application on Azure

Tibadaya, Nirbhay 21 Reputation points
2023-01-29T19:22:42.8033333+00:00

I want to send an email to given user from the registered Application on Azure.

something like this(MS graph API)

https://graph.microsoft.com/v1.0/apps/{tenantid/appid}/sendMail

Outlook
Outlook
A family of Microsoft email and calendar products.
3,298 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,193 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Glen Scales 4,431 Reputation points
    2023-01-29T22:58:15.8733333+00:00

    You can't send email from an an ApplicationId or Service Principal, it needs to come from either a real user or a shared mailbox. If your using the client credentials flow https://video2.skills-academy.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow and you have assigned the Application permission for Mail.Send then your application can send a message using a user's or shared Maibox Sendmail endpoint eg

    https://graph.microsoft.com/v1.0/users/shared@mailbox.com/sendMail
    
    
    0 comments No comments