node.js - nodemailer 解析 localhost 而不是 smtp 传输定义
问题描述
我有以下配置
{
host: 'smtp.sendgrid.net',
port: 587,
secure: false,
auth: {
user: 'apikey',
pass: this.configService.get<string>('SENDGRID_API_KEY'),
},
}
但 nodemailer 正在解析 localhost 提供程序。我收到以下错误:
Error: connect ECONNREFUSED 127.0.0.1:587
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {
errno: 'ECONNREFUSED',
code: 'ESOCKET',
syscall: 'connect',
address: '127.0.0.1',
port: 587,
command: 'CONN'
}
任何帮助,将不胜感激。
解决方案
推荐阅读
- angular - 全局定位的overlayRef的角度cdk覆盖更新位置
- javascript - jquery hide/show 在节点 js 中没有按预期工作
- javascript - Javascript 错误:无法使用画布标记读取 null 的属性“getContext”
- java - 如何监视引导上下文 bean
- unity3d - 冻结后没有发生碰撞
- python - 使用fuzzywuzzy 时出错:UserWarning: Using slow pure-python SequenceMatcher。安装 python-Levenshtein 以删除此警告
- node.js - 是否有任何选项可以在树结构中安装软件包,例如 0.12 以下的节点版本如何使用
- mysql - 使用表中的 created_at 值从 laravel 的数据库中获取最近 7 个季度的数据
- r - Shinyapps.io 部署包安装失败
- javascript - 如何在 html 中隐藏表格行,使用 javaScript 将条件作为行值?如果两行值相同,则隐藏一个