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 | Windows | Classic Outlook for Windows | For business
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Glen Scales 4,446 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://learn.microsoft.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/******@mailbox.com/sendMail
    
    
    0 comments No comments

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.