小编yas*_*gra的帖子

使用 Nodemailer nodejs 发送邮件的现代 Oauth2 身份验证

我正在使用nodemailer我的 Nodejs 应用程序发送电子邮件。

var payload = { auth: 
               {
                user: smtpuser,
                pass: smtppass
               },
                to : toAddr,
                from  : emailfrom,
                cc : ccAddr,
                subject : subject,
                html    : content,
                attachments: attachments
              };

var transporter = nodemailer.createTransport(
                   { host: payload.host || 'smtp.office365.com', // Office 365 server
                     port: payload.port || 587,     // secure SMTP
                     secure:payload.secure || false, // false for TLS - as a boolean not string - but the default is false so just remove this completely
                     auth: payload.auth, …
Run Code Online (Sandbox Code Playgroud)

node.js oauth-2.0 nodemailer exchange-basicauth

7
推荐指数
2
解决办法
9472
查看次数