2012-07-17 145 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 
} 
相關問題