2012-07-17 146 views
0

我发现这个职位Using Amazon SES with Rails ActionMailer,并随后在https://github.com/abronte/Amazon-SES-Mailer发现的例子,但发送邮件SSL错误通过亚马逊SES-宝石邮件发送电子邮件时

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

配置/环境/发展时,我得到这个错误.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) 

为什么我在SS L错误在这里?我尝试使用个人Gmail帐户使用smtp的另一个配置,并发送电子邮件就好了。这是SES的问题吗?我该如何解决?

+0

发送它时你在HTTPS?同样的错误在这里http://stackoverflow.com/questions/4528101/ssl-connect-returned-1-errno-0-state-sslv3-read-server-certificate-b-certificat – 2012-07-17 06:14:57

+0

我在我的本地主机上。 – Diffy 2012-07-17 06:15:44

回答

0

我不认为你需要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 
} 
相关问题