Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 如何配置sendgrid';从电子邮件到电子邮件?_Node.js_Email_Sendgrid_Nodemailer - Fatal编程技术网

Node.js 如何配置sendgrid';从电子邮件到电子邮件?

Node.js 如何配置sendgrid';从电子邮件到电子邮件?,node.js,email,sendgrid,nodemailer,Node.js,Email,Sendgrid,Nodemailer,我正在使用node.js的电子邮件模块nodemail和sendgrid API向用户发送电子邮件 这是我发送电子邮件的代码 SOURCE_EMAIL = ?????; var options = { auth: { api_user: sendgrid.api, api_key: sendgrid.key } }; tr

我正在使用node.js的电子邮件模块nodemail和sendgrid API向用户发送电子邮件

这是我发送电子邮件的代码

        SOURCE_EMAIL = ?????;
        var options = {
            auth: {
                api_user: sendgrid.api,
                api_key: sendgrid.key
            }
        };
        transport = nodemailer.createTransport(sgTransport(options));
        transport.sendMail({from: SOURCE_EMAIL, to: email, subject: subject, html: html}, function(err,data){
}); 

我的问题是,当我使用sendgrid API发送电子邮件时,我应该配置什么源邮件?

您可以将
源邮件设置为您想要的任何内容

最好将其设置为您拥有、控制并可以从中接收电子邮件的电子邮件

然而,这完全取决于你