小编use*_*254的帖子

Javascript Azure Function 使用 SendGrid 发送电子邮件

我想使用 SendGrid 从 Azure 函数 (Javascript) 发送电子邮件。我做了以下事情

  1. 为 SendGrid API 密钥创建了一个新的 AppSettings
  2. Azure Function 的 SendGrid 输出绑定集
  3. 以下是我的Azure功能

 

    module.exports = function (context, myQueueItem) {
var message = {
         "personalizations": [ { "to": [ { "email": "testto@test.com" } ] } ],
        from: { email: "testfrom@test.com" },        
        subject: "Azure news",
        content: [{
            type: 'text/plain',
            value: myQueueItem
        }]
    };
    context.done(null, message);
};
Run Code Online (Sandbox Code Playgroud)

但电子邮件没有发送。请提供一些指示

javascript azure sendgrid azure-functions

2
推荐指数
1
解决办法
2141
查看次数

标签 统计

azure ×1

azure-functions ×1

javascript ×1

sendgrid ×1