Sending an email using Azure SDK

牧云@^-^@ 提交于 2019-12-13 04:17:12

问题


I use azure-graph in my Node.js project:

const MsRest = require('ms-rest-azure');    
const credentials = await MsRest.loginWithServicePrincipalSecret(keys.appId, keys.pass, keys.tenantId, { tokenAudience: 'graph' });
const GraphkManagementClient = require('azure-graph');
const client = new GraphkManagementClient(credentials, subscriptionId);
return client.users.get(principalID);

I want to use the Azure SDK also to send emails.

I know how to do that in low level using the API directly:

But I want to do it via the SDK like the rest of my project.

My problem is, I have not found any method for sending an email in the docs: azure-graph package. I need a method that allows me (with the proper privileges of course) to send email as any user in the organization.


回答1:


You can use the Graph JavaScript SDK which is a wrapper around the Microsoft Graph API that can be used server-side and in the browser to send mails to users. Please refer to Graph Javascript SDK to learn more about the same. Also, refer to nodejs-connect-sample to use Microsoft Graph API and the Graph JavaScript SDK to send an email.



来源:https://stackoverflow.com/questions/54080176/sending-an-email-using-azure-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!