当我尝试用npm包sendgrid/mail发送电子邮件时,有时会弹出此错误消息。这在大多数情况下是可行的。
{错误:在TCPConnectWrap.afterConnect as oncomplete errno:‘ETIMEDOUT’连接ETIMEDOUT 169.45.89.179:443,代码:'ETIMEDOUT',syscall:' connect ', 地址:'169.45.89.179',端口: 443 } bugsnag报告一个未处理的拒绝…错误:将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);
});发布于 2019-02-25 08:12:28
我不认为这是您的代码或网络一方的问题,除非您同时存在一般性的连接问题。
ip 169.45.89.179解决了sendgrid的域,因此这可能是它们的一个问题,如果要对此进行双重检查,可以将连续ping设置为8.8.8.8,或者运行其他设置的网络监视,以确保连接稳定。
如果您的连接不是问题所在,我将向它们报告它以及您准备共享的任何日志,您的源ip和超时错误发生的时间对它们可能是有用的。
https://stackoverflow.com/questions/54861659
复制相似问题