Warm tip: This article is reproduced from stackoverflow.com, please click
azure email outlook sharepoint

Sending Mails from Azure/Azure Function/Outlook from Current User

发布于 2020-04-19 09:17:36

The requirement for our application is to send emails from current user.

The trigger is created from SharePoint.

We tried Outlook from Logic Apps( But it requires to sign-in initially whoever creates the Logic App. Tried the 'Send on Behalf'function. But we can't provide that access to all the users.)

We tried SendGrid. But because of it's email limitation and since it's a third party, we couldn't use it.

We tried Microsoft.Office.Interop.Outlook, but couldn't get a fruitful outcome.

We don't have smtp server as well.

We have an Azure and SharePoint Subscription. Is there any method to send from current user or on behalf of current user using these?

Is there any built-in Outlook options that we can leverage to send emails in Azure? There is an option called Exchange Online in Azure. But couldn't find enough documentation to actually implement it.

Questioner
Aswathy Santhosh
Viewed
58
ManojReddy-MSFT 2018-12-26 20:15
  1. You can achieve this using Microsoft Graph API. "Microsoft Graph lets your app get authorized access to a user's Outlook mail data in a personal or organization account. With the appropriate delegated or application permissions, your app can access the mail data of the signed-in user or any user in a tenant. The mail data can be in the cloud on Exchange Online as part of Office 365, or on Exchange on-premises in a hybrid deployment."

You can find the mail API reference here and more about the mail API here.

  1. You can also consider creating an account in Azure AD which has "Send on Behalf of" permissions for all the users and use that account to sign in to the logic app.