Rails アプリでオブジェクトを作成してMailいて、メーラー設定を選択する必要があります。
original = UserMailer.new_registration
original.deliver# Does the job
custom = Mail.new(original.to_s)
custom.deliver # Fails: OpenSSL::SSL::SSLError: hostname does not match the server certificate
カスタムMailオブジェクトが Rails の設定を反映していないようです。