---
title: "ActionMailer: Hostname not match server certificate"
author: "qwlong"
date: "2011-05-26T17:24:44Z"
tags: []
categories: ["编程语言"]
slug: "actionmailer-hostname-not-match-server-certificate"
draft: false
lastmod: "2011-05-26T17:24:44Z"
id: 1059894
url: "https://qwlong.iteye.com/blog/1059894"
---

ActionMailer: Hostname not match server certificate 错误的解决办法

解决办法：
development.rb
<span style="color:red">require 'tlsmail'</span>
  config.action_mailer.delivery_method = :smtp
  ActionMailer::Base.smtp_settings = {
      :address => '',
      :port => 25,
      :domain => '',
      :authentication => :login,
      :user_name => '',
      :password => '',
      :enable_starttls_auto => true
  }

Gemfile

<span style="color:red">gem 'tlsmail'</span>