Rails 3 action mailer production OpenSSL :: SSL :: SSLError: the host name does not match the server certificate

I had a problem with an Open SSL certificate error when sending email to a production server. Everything works fine in development mode. The following is the configuration code in run mode.

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'
}

I already examined the solution in a previous post, but this does not solve my problem.

Can anyone help with this?

+4
source share
1 answer

Try adding a domain name to smtp_setings

:domain => 'www.your-domain-name.com'
0
source

Source: https://habr.com/ru/post/1539466/


All Articles