【发布时间】:2018-07-21 19:28:51
【问题描述】:
所以我使用 Sendgrid,一个处理交易电子邮件的外部 SMTP 服务器。
我刚刚在一个全新的 VPS 上部署了我的 Rails 应用程序,上面装有 Ubuntu。
在Sendgrid tutorial 中,我看到我只需将 ActionMailer 设置为使用正确的用户名/密码指向 sendgrid 的 SMTP 地址。
但我遇到了Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 25 错误,但我确定我已将其设置为指向 Sendgrid 的 587 端口。我在网上搜索,有人建议我安装postfix。我猜 ActionMailer 需要本地主机上的 MTA。
sendmail 或 postfix 是在 Linux 上使用外部 SMTP 服务所需的软件包吗?
【问题讨论】:
-
你能显示 SMTP 配置吗?
-
你能显示 config.action_mailer.delivery_method 设置吗?
-
还有 config.action_mailer.default_url_options 设置?
标签: ruby-on-rails email sendmail actionmailer sendgrid