I just got the following error from ActionMailer when trying to send to a Gmail address:
OpenSSL::SSL::SSLError (hostname was not match with the server certificate)
After some Googling I found the “enable_starttls_auto” option in ActionMailer, setting this to “false” in the relevant environment file fixed the problem:
config.action_mailer.smtp_settings = { :address => '...', :user_name => '...', :domain => '...', :password => '...', :authentication => :login, :enable_starttls_auto => false }
This option apparently “Enables SMTP/TLS (STARTTLS) for this object if server accepts”. Not being up on my “SMTP/TLS”‘s, I have no idea what this means but it solves the problem.
Hope this saves someone some time.