错误:在TLSWrap.onStreamRead中读取ECONNRESET

3

我正在尝试使用@sendgrid/email库在我的nodejs应用程序中发送电子邮件,但是当我尝试发送电子邮件时,我会得到以下错误:

{ 错误:读取ECONNRESET       在 TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27) errno:'ECONNRESET',code:'ECONNRESET',syscall:'read' }


我尝试了以下代码,请看一下。

const sgMail = require('@sendgrid/mail');
sgMail.setApiKey('***************************'); // API KEY
sgMail.send({
  to: email,
  from: 's*****@gmail.com',
  subject: 'signup succeeded!',
  html: '<h1>You Successfully Signed Up!</h1>'
})

我该如何解决这个问题?

1个回答

1

检查是否使用代理。

当您的发送机器无法连接到SendGrid API服务器时,会出现此错误。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接