0

我发现这篇文章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"

配置/环境/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有问题吗?我该如何解决?

4

1 回答 1

0

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

Amazon SES 现在支持 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
}
于 2012-07-18T08:49:57.303 回答