简体   繁体   English

错误:连接被拒绝-“ localhost”端口25的connect(2)

[英]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.

相关问题 连接被拒绝 - “localhost”端口 25 rails 的 connect(2) - Connection refused - connect(2) for "localhost" port 25 rails 连接被拒绝-“ localhost”端口25 Chef devops的connect(2) - Connection refused - connect(2) for “localhost” port 25 chef devops SendGrid + Ruby on Rails 6 on DigitalOcean Apps + Errno::ECONNREFUSED(连接被拒绝 - “localhost”端口 25 的连接(2)): - SendGrid + Ruby on Rails 6 on DigitalOcean Apps + Errno::ECONNREFUSED (Connection refused - connect(2) for “localhost” port 25): 连接被拒绝-“ localhost”端口587的connect(2) - Connection refused - connect(2) for “localhost” port 587 连接被拒绝 - 使用DigitalOcean连接(2)“localhost”端口9200 - Connection refused - connect(2) for “localhost” port 9200 with DigitalOcean HTTP.get上的Capybara错误:HTTP :: ConnectionError异常:无法连接:连接被拒绝-“ localhost”端口3000的connect(2) - Capybara error on HTTP.get: HTTP::ConnectionError Exception: failed to connect: Connection refused - connect(2) for “localhost” port 3000 使用Rails 4和Devise发送电子邮件时出错(连接被拒绝,端口25) - Error sending emails with Rails 4 & Devise (connection refused, port 25) 法拉第:: ConnectionFailed,连接被拒绝 - 连接(2)为“localhost”端口9200错误Ruby on Rails - Faraday::ConnectionFailed, Connection refused - connect(2) for “localhost” port 9200 Error Ruby on Rails Errno :: ECONNREFUSED(连接被拒绝-“ localhost”端口587的connect(2))操作邮件 - Errno::ECONNREFUSED (Connection refused - connect(2) for “localhost” port 587) action mailer curl: (7) 无法连接到本地主机端口 3000:连接被拒绝 - curl: (7) Failed to connect to localhost port 3000: Connection refused
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM