Rails 使用腾讯企业邮箱如何设置 action_mailer

xranthoar · 2013年10月01日 · 最后由 disney2002 回复于 2017年11月01日 · 5373 次阅读

现在项目中是这么配置的

config.action_mailer.smtp_settings = {
  address: 'smtp.exmail.qq.com',
  port: 465,
  domain: 'example.com',
  user_name: '[email protected]',
  password: 'secret',
  authentication: 'plain',
  enable_starttls_auto: true
}

但是发送邮件时报错 Net::ReadTimeout: Net::ReadTimeout

各位有使用腾讯企业邮箱配置 action_mailer 的经验吗?谢谢!

 config.action_mailer.smtp_settings = {
   :address => "smtp.exmail.qq.com",
   :port => "25",
   :domain => "exmail.qq.com",
   :authentication => :login,
   :user_name => "[email protected]",
   :password => "password",
   :enable_starttls_auto => true
}

#1 楼 @song940 原来是 25 端口,谢谢!it works

这个问题坑了我也好一会儿。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号