在生产服务器中发送电子邮件时,我遇到了 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'
}
我已经看过 previous post 中的解决方案了但是,这并不能解决我的问题。
任何人都可以帮助解决这个问题吗?
最佳答案
尝试在 smtp_setings 中添加域名
:domain => 'www.your-domain-name.com'
关于ruby-on-rails - Rails 3 操作邮件程序制作 OpenSSL::SSL::SSLError: 主机名与服务器证书不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23499615/