A community member has associated this post with a similar question:
Building an app to send email using Microsoft Graph API through which different user of different company domain can send email

Only moderators can edit this content.

Building an app with Microsoft Graph API to enable cross-domain email sending

Subhasis Ghosh 0 Reputation points
2024-09-30T13:32:46.16+00:00

I'm building a C# application that will utilize Microsoft Graph API to allow users from different email domains to send emails. So far, I've completed the following steps:

  1. Registered my application through Azure App Registration under multi-tenant option.
  2. Used Redirect URI as default - "https://login.microsoftonline.com/common/oauth2/nativeclient" since this is a desktop application.
  3. Specified my company's Azure admin as the owner of the application.
  4. Added delegated permission for Microsoft Graph API User.Read and Mail.Send.
  5. Used clientID from the Azure App registration page and tenantID as common in the code.
  6. Utilized AcquireTokenInteractive() to obtain the access token interactively from user.
  7. Sent the email.

However, when a user from a different domain attempts to send emails using my application, they receive a window requesting approval for access token. I have the following questions:

  1. If the user presses the request for approval button, does it trigger an email to the azure admin of the other domain for approval?
  2. Or does the azure admin of the other domain need to approve the request from their azure ad admin page?
  3. Is Azure Admin access required to perform this task?
  4. What's the best practice to handle this scenario, so that a user from a different domain can send emails using my application?

I appreciate your assistance!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,225 questions
{count} votes