相关疑难解决方法(0)

Sendgrid v3 邮件返回 202 但电子邮件不发送

我正在尝试通过 Sendgrid 向已注册第一个的用户发送电子邮件验证。按照此处找到的 v3_mail 示例,我创建了以下实现:

const querystring = require('querystring');
const helper = require('sendgrid').mail;
const https = require('https');

const url = "http://<mywebsite.com>/users/reset/passwordLoggedOut?";
let sg = require('sendgrid')(process.env.SENDGRID_API_KEY);

const emails = {};

function sendMail(mail){
    const request = sg.emptyRequest({
       method: 'POST',
       path: '/v3/mail/send',
       body: mail.toJSON(),
    });

    sg.API(request, function(error, response) {
       console.log(response.statusCode);
       console.log(response.body);
       console.log(response.headers);
       console.log(error);
    });
}

emails.sendActivationEmail = function(user){
     let qso = {username: user.username, activationCode: user.activationCode};
     let qs = querystring.stringify(qso);
     let from = new helper.Email('Thomas.Talhelm@chicagobooth.edu');
     let to = new helper.Email(user.username);
     let subject …
Run Code Online (Sandbox Code Playgroud)

email node.js sendgrid sendgrid-api-v3

6
推荐指数
0
解决办法
3885
查看次数

NodeJS Sendgrid 向多个收件人发送电子邮件的问题

我在向多个收件人发送邮件时遇到问题。

我的脚本是

var SendGrid = require('sendgrid').SendGrid;
var sendgrid = new SendGrid('<<username>>', '<<password>>');      
    sendgrid.send({
    to: 'nabababa@gmail.com',   
from: 'sengupta.nabarun@gmail.com',
bcc: ["sengupta.nabarun@gmail.com","sengupta_nabarun@rediffmail.com"],
Run Code Online (Sandbox Code Playgroud)

我在这里有两个问题

  1. 我可以列出一组收件人吗?
  2. 如何在密件抄送列表中获取一组收件人?

与上述两个查询相关的解决方案确实会有所帮助

谢谢纳巴伦

node.js sendgrid

4
推荐指数
2
解决办法
3945
查看次数

标签 统计

node.js ×2

sendgrid ×2

email ×1

sendgrid-api-v3 ×1