Rails 3动作邮件程序生成OpenSSL :: SSL :: SSLError:主机名与服务器证书不匹配

Shy*_*tty 5 openssl ruby-on-rails actionmailer ruby-on-rails-3.2

我在生产服务器中发送电子邮件时遇到Open SSL证书错误问题.在开发模式下一切正常.以下是我在生产模式下的配置代码.

config.action_mailer.raise_delivery_errors = true

config.action_mailer.delivery_method = :smtp

config.action_mailer.smtp_settings = {
 :address => "smtp.gmail.com",
 :port => 587,  
 :authentication => "plain",
 :enable_starttls_auto => true,
 :user_name => 'xxxxxxx',
 :password => 'xxxxx',
 :openssl_verify_mode  => 'none'
}
Run Code Online (Sandbox Code Playgroud)

我已经看过上一篇文章中的解决方案但是,这并没有解决我的问题.

有人可以帮助这个吗?

小智 0

尝试在 smtp_setings 中添加域名

:domain => 'www.your-domain-name.com'
Run Code Online (Sandbox Code Playgroud)