【问题标题】:SSL Error when sending email via amazon-ses-mailer gem通过 amazon-ses-mailer gem 发送电子邮件时出现 SSL 错误
【发布时间】:2012-07-17 06:09:44
【问题描述】:

我发现这篇文章Using Amazon SES with Rails ActionMailer 并按照https://github.com/abronte/Amazon-SES-Mailer 上的示例进行操作,但发送邮件时出现此错误

    "SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed"

config/environments/development.rb:

config.action_mailer.delivery_method = AmazonSes::Mailer.new(
    :secret_key => 'AKIAJ*******',
    :access_key => 'Ahs08*********'
)

发送消息:

mailer = ActionMailer::Base.delivery_method = AmazonSes::Mailer.new(
    :secret_key => 'AKI*******',
    :access_key => 'Ah***********'
  )
mailer.deliver( UserMailer.test(@this_user.email).encoded )

为什么会出现 SSL 错误?我尝试使用带有个人 gmail 帐户的 smtp 进行另一种配置,并且它发送电子邮件就好了。 SES有问题吗?我该如何解决这个问题?

【问题讨论】:

标签: ruby-on-rails ruby ruby-on-rails-3 amazon-ses


【解决方案1】:

我认为您不再需要 SES Mailer gem。 SES 过去仅支持 TLS 包装器,但截至 2012 年 3 月 7 日...

Amazon SES now supports STARTTLS

正如this SO question 的回答中所述。它应该很简单......

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  :address => "email-smtp.us-east-1.amazonaws.com",
  :user_name => "..." # Your SMTP user here.
  :password => "...", # Your SMTP password here.
  :authentication => :login,
  :enable_starttls_auto => true
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多