sendgrid设置@ sendgrid / mail

问题描述 投票:1回答:1

当我尝试使用npm包sendgrid / mail发送电子邮件时,有时会弹出此错误消息。这在大多数时候都适用。

{错误:连接ETIMEDOUT 169.45.89.179:443在TCPConnectWrap.afterConnect [as oncomplete](net.js:1104:14)错误:'ETIMEDOUT',代码:'ETIMEDOUT',系统调用:'connect', 地址:'169.45.89.179',端口:443} [bugsnag]报告未处理的拒绝...错误:错误:在SendGrid.send.then.catch.e连接ETIMEDOUT 169.45.89.179:443(/ home / leoqiu / foodnome-api /build/src/utils/emailHelpers.js:143:11)

我的节点服务器使用以下代码将其发送出去:

export const sendVerifyMail = (to: string, token: string) =>
  SendGrid.send({
    to,
    from: { email: '..' },
    subject: 'Verify you..',
    dynamic_template_data: {
      header: 'Verify your account',
      text:
        'Please use the button below to continue the process.',
      c2a_link: `${serverAddress}/api/user-account/verify?token=${token}`,
      c2a_button: 'Verify'
    },
    template_id: 'd-0f6411434fbc4896bf389e3945affd5d'
  } as any)
    .then(d => d)
    .catch(e => {
      console.log(e);
      throw new Error(e);
    });
node.js sendgrid
1个回答
1
投票

我不认为这是您的代码或网络方面的问题,除非您同时遇到一般连接问题。

ip 169.45.89.179解析为sendgrid的域,所以这可能是他们的问题,要仔细检查一下你可以设置连续ping到8.8.8.8或运行一些其他网络监控设置以确保你的连接输出稳定。

如果您的连接不是问题,我只会向您报告它以及您准备共享的任何日志,您的源IP和发生超时错误的时间可能对他们有用

© www.soinside.com 2019 - 2024. All rights reserved.