javascript - 使用 sendgrid npm 模块来自 node.js 的未处理的承诺拒绝错误
问题描述
可能是什么原因?节点给了我未处理的承诺拒绝错误代码有什么问题。
已成功要求 sendgrid 模块,并且已正确设置 sendgrid API 密钥,但代码仍然给我错误。
sgMail.send({
to: 'somebody@gmail.com',
from: 'somebodygmail.com',
subject: 'This is my first creation!',
text: 'I hope this one actually get to you'
})
解决方案
尝试:
sgMail.send({
to: 'somebody@gmail.com',
from: 'somebodygmail.com',
subject: 'This is my first creation!',
text: 'I hope this one actually get to you'
}).then(out=>console.log(out)).catch(e=>console.log(e))
您将能够识别错误。如果没有,则将日志发布到问题中。
编辑:
可能的原因:
来自电子邮件无效
推荐阅读
- excel - 从具有多个页面的网站中抓取数据
- authorization - 在 HCL OneTest Data 中,admin 用户是否有权更改用户的权限?
- apk - 在新的 Google Play 控制台 UI 中找不到“编辑发布”选项
- java - 在运行时更改超时 - Elasticsearch RestHighLevelClient
- apache - 漂亮的 RewriteRule 回到旧格式
- php - 为什么 CI 库不发送电子邮件也不显示错误
- android - android是否支持通知图标的矢量可绘制?
- azure-data-factory - 有没有办法对 Azure 数据流中不同数量的列进行自定义动态映射或任何其他选项来实现这一点?
- c# - 从 ASP.NET MVC 视图向控制器传递值
- c - C 编程问题 - 最大分区