我正在尝试使用@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>'
})
我该如何解决这个问题?