本文介绍了错误:在 TLSWrap.onStreamRead 处读取 ECONNRESET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用 @sendgrid/email 库在我的 nodejs 应用程序中发送电子邮件,但是当我尝试发送电子邮件时,出现以下错误:
I am trying to send an email in my nodejs app using @sendgrid/email library but when I try to send an email I am getting the following error:
{ 错误:读取 ECONNRESET在 TLSWrap.onStreamRead
(internal/stream_base_commons.js:111:27) 错误号:'ECONNRESET',代码:'ECONNRESET',系统调用:'read' }
我尝试了以下代码,请看一下.
I tried the following code please have a look.
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>'
})
我该如何解决这个问题?
How do I fix this issue?
推荐答案
检查您是否支持代理.当您的发送机器无法连接到 sendgrid api 服务器时会发生此错误.
Check if you are behind proxy.This error occurs when your sending machine is not able to connect to sendgrid api server.
这篇关于错误:在 TLSWrap.onStreamRead 处读取 ECONNRESET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!