【问题标题】:Using Node JS client I tried to send email via Sendgrid web API but CC or BCC not working使用 Node JS 客户端,我尝试通过 Sendgrid Web API 发送电子邮件,但 CC 或 BCC 不起作用
【发布时间】:2020-12-02 16:31:18
【问题描述】:

我使用的是 sendgrid v6.4.0,使用动态模板向 cc & bcc 发送电子邮件被忽略。在下面找到有效载荷 -

{
  subject: 'Hello world',
  message: 'Hello plain world!',
  from: 'abcd@abcd.com',
  to: 'a@b.com',
  cc: 'b@b.com'
  bcc: 'c@b.com'
};

CC 和 BCC 被忽略,只有a@b.com 收到的电子邮件

注意:我发现了一个类似的问题,但没有答案。 sendgrid : add cc in email

【问题讨论】:

    标签: node.js email sendgrid


    【解决方案1】:

    用于通过抄送和密件抄送向单个收件人发送一封电子邮件

        const msg = {
          "personalizations": [
        {
          "to": [
            {
              "email": "a@b.com"
            }
          ],
          "cc": [
            {
              "email": "b@b.com"
            }
          ],
    "bcc": [
                {
                  "email": "c@b.com"
                }
              ]
            }
          ]
              from: 'abcd@abcd.com',
              subject: 'Hello World',
              text: 'Hello plain world',
            };
            
            sgMail.send(msg).then(() => {
              console.log('emails sent successfully!');
            }).catch(error => {
              console.log(error);
            });
    

    更多信息请参考this

    【讨论】:

      猜你喜欢
      • 2018-01-22
      • 1970-01-01
      • 1970-01-01
      • 2014-03-30
      • 2019-06-14
      • 2022-01-13
      • 2019-04-28
      • 2017-01-25
      • 1970-01-01
      相关资源
      最近更新 更多