Rails邮件程序不起作用Net :: OpenTimeout

Rails Server在本地Mac中运行。 Mailer在我的办公室网络中工作并发送邮件,但在我的家庭(宽带)网络中不工作。一些网络问题?

这是错误:

Net::OpenTimeout

这是我在development.rb中的设置:

config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    address: 'smtp.gmail.com',port: 587,domain: 'gmail',authentication: 'plain',user_name:  '***@gmail.com',password: '******',enable_starttls_auto: true
  }
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.perform_deliveries = true
  #config.action_mailer.delivery_method = :test
  host = 'localhost:3000'
  config.action_mailer.default_url_options = { host: host,protocol: 'https' }

我尝试使用其他端口,但没有帮助。可能是什么问题,或者我该如何调试?

jjj0716 回答:Rails邮件程序不起作用Net :: OpenTimeout

是的,似乎绝对是网络问题。
随着MacOS摆脱telnet,您可以使用netcat

$ nc -vz smtp.gmail.com 587
Connection to smtp.gmail.com port 587 [tcp/submission] succeeded!

然后询问您的Internet提供商支持是否“成功”。
错误的端口超时示例:

nc -vz smtp.gmail.com 1187
nc: connectx to smtp.gmail.com port 1187 (tcp) failed: Operation timed out
本文链接:https://www.f2er.com/2693482.html

大家都在问