Confirmation email from devise on rails3 using gmail not arriving

泪湿孤枕 提交于 2019-12-03 13:50:12

I had the very same problem; in my case was due to a bug (Net::SMTP does not how to speak TLS, which is required by gmail) and I solved it as explained here.

Rather than turning off SSL cert verification globally, you can pass an extra parameter to smtp_settings:

config.action_mailer.smtp_settings = {
  :address              => 'smtp.example.com',
  :port                 => '25',
  :domain               => 'example.com',
  :user_name            => 'someone@example.com',
  :password             => 'secret',
  :authentication       => 'plain',
  :enable_starttls_auto => true,
  :openssl_verify_mode  => OpenSSL::SSL::VERIFY_NONE,
}

You may also need to require 'openssl' to get that constant.

This solution also works with Pony, if you include :openssl_verify_mode in the :via_options hash.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!