错误:
*telnet smtp.gmail.com 587 ok
telnet smtp.gmail.com 25 ok
Connection refused - connect(2) for nil port 2
配置:
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'gmail.com',
user_name: 'rapid.virus.0@gmail.com',
password: '55xxxxxx',
authentication: :plain,
enable_starttls_auto: true
}
答案 0 :(得分:1)
有两件事可以帮助您解决“拒绝连接”问题
配置/环境/ development.rb
config.action_mailer.default_url_options = { :host => 'xxx.xxx.xxx.xxx' }