簡體   English   中英

無法從 sendgrid nodejs 發送 email

[英]unable to send email from sendgrid nodejs

使用 sendGrid 發送 email 時出現以下錯誤

這個錯誤的原因可能是什么。 Sendgrid 安裝並導入

 Error: getaddrinfo ENOTFOUND api.sendgrid.com at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26) { errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'api.sendgrid.com', config: { url: '/v3/mail/send', method: 'post', data: '{"subject":"Invitation to join xxxxxxxxx","personalizations":[{"to":[{"email":"xxxx@gmail.com"}]}],"content":[{"value":"Email received from a friend at xxxxxxxxx \\n Join xxxxxxxx to grow together","type":"text/plain"},{"value":"\\n <h4>Email received from contact form: </h4>\\n <p>Join xxxxxxxx to grow together</p>\\n <hr />\\n <p>This email may contain sensitive information</p>\\n <p>https://www.xxxxxxx.org</p>\\n ","type":"text/html"}]}', headers: { Accept: 'application/json', 'Content-Type': 'application/json', 'User-Agent': 'sendgrid/7.4.3;nodejs', Authorization: 'Bearer xxxxxxxxxxxxx', 'Content-Length': 546 }, baseURL: 'https://api.sendgrid.com/', transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 0, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: Infinity, maxBodyLength: Infinity, validateStatus: [Function: validateStatus] }, }

我會感謝你的幫助

我懷疑這可能是 DNS 問題(如錯誤日志所示)。 我在發送時遇到了同樣的問題,結果是 DNS 問題。 幾分鍾后,我的網絡已恢復,並且再次正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM