Building an app to send email using Microsoft Graph API
I am developing an application using C# that will be able to send email using Microsoft Graph API. My main intention is that using this application, different users from different companies (i.e. different email domains) will be able to send emails.
I am providing details of what I have done till now.
Suppose my company’s email domain is email address removed for privacy reasons.
The Azure admin of my company has registered an application through Azure App registration under multi-tenant option.
As this is a desktop application, we are using Redirect URI as default – https://login.microsoftonline.com/common/oauth2/nativeclientMy company’s azure admin (email address removed for privacy reasons) is the owner of the application.Delegated permission for Microsoft Graph API User.Read and Mail.Send is added.
In the code, I have used clientID from the Azure App registration page and tenantID as common
Then I use AcquireTokenInteractive() to acquire token interactively from user.
And then sending the mail –
So my question is, when someone from other domain tries to send email using this application, he/she is getting this window asking for approval for access token –
So, what happens when the user press request for approval? –
Does it trigger an email to xyz company azure admin for approval?Or xyz azure admin need to approve the request for the requested user from their azure ad admin page?Is Azure Admin access is absolutely necessary for this?Lastly, can you please let me know what is the best way to handle this scenario i.e. what settings or coding to be done so that different user from different companies (i.e. different domain like xyz.co.in) can send email using my application (registered in azure AD by my organization email address removed for privacy reasons)
I am developing an application using C# that will be able to send email using Microsoft Graph API. My main intention is that using this application, different users from different companies (i.e. different email domains) will be able to send emails. I am providing details of what I have done till now. Suppose my company’s email domain is email address removed for privacy reasons.The Azure admin of my company has registered an application through Azure App registration under multi-tenant option. As this is a desktop application, we are using Redirect URI as default – https://login.microsoftonline.com/common/oauth2/nativeclientMy company’s azure admin (email address removed for privacy reasons) is the owner of the application.Delegated permission for Microsoft Graph API User.Read and Mail.Send is added. In the code, I have used clientID from the Azure App registration page and tenantID as common Then I use AcquireTokenInteractive() to acquire token interactively from user. And then sending the mail – So my question is, when someone from other domain tries to send email using this application, he/she is getting this window asking for approval for access token – So, what happens when the user press request for approval? –Does it trigger an email to xyz company azure admin for approval?Or xyz azure admin need to approve the request for the requested user from their azure ad admin page?Is Azure Admin access is absolutely necessary for this?Lastly, can you please let me know what is the best way to handle this scenario i.e. what settings or coding to be done so that different user from different companies (i.e. different domain like xyz.co.in) can send email using my application (registered in azure AD by my organization email address removed for privacy reasons) Read More