[英]Error: Connection refused - connect(2) for “localhost” port 25
Trying to send mail with Mailgun as default. 尝试使用Mailgun作为默认发送邮件。
Successfully connects to heroku telnet smtp.mailgun.org with ports 25 587 (TLS) and 465 (SSL) 使用端口25587(TLS)和465(SSL)成功连接到heroku telnet smtp.mailgun.org
The config for smtp is setup like the documentation wants. smtp的配置如文档所愿进行设置。 The environment variables were generated by Mailgun/Heroku and I updated the domain per the documentation to the mx record change.
环境变量是由Mailgun / Heroku生成的,我根据文档将域更新为mx记录更改。
Rails.application.config.action_mailer.delivery_method = :mailgun
Rails.application.config.action_mailer.mailgun_settings = {
api_key: ENV['MAILGUN_API_KEY'],
domain: ENV['MAILGUN_DOMAIN'],
}
I know I've seen this error on a few threads, but I've yet to make this work. 我知道我已经在几个线程上看到此错误,但是我还没有使它工作。
I'll reply if I find another thread that solves this before this one figures it out. 如果找到另一个解决该问题的线程,我会回答。
This has been figured out. 这已经弄清楚了。 Here was my issue:
这是我的问题:
The configuration settings should go in environments/production.rb and environments/development.rb 配置设置应该放在环境/production.rb和环境/development.rb中
NOT in a mailgun.rb initializer. 不在mailgun.rb初始化程序中。
Thanks for playing. 感谢参与。 Woo.
呜。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.