使用Azure SDK发送电子邮件 [英] Sending an email using Azure SDK

查看:203
本文介绍了使用Azure SDK发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Node.js项目中使用azure-graph:

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);

我也想使用Azure SDK发送电子邮件.

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

我知道如何直接使用API​​在底层进行操作:

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

但是我想像我项目的其余部分一样通过SDK进行操作.

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.

推荐答案

您可以使用Graph JavaScript SDK,它是Microsoft Graph API的包装,可以在服务器端和浏览器中使用它来向用户发送邮件.请参考图形Javascript SDK ,以了解有关此内容的更多信息.另外,请参考 nodejs-connect-sample 以使用Microsoft Graph API和Graph JavaScript使用SDK发送电子邮件.

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.

这篇关于使用Azure SDK发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆