2015-05-14 46 views
0

我試圖修復它,但無濟於事。請幫忙。ssl_connect返回= 1 errno = 0狀態= sslv2/v3讀服務器你好一個未知的協議軌4

config.action_mailer.raise_delivery_errors = true 
    # config.assets.debug = true 
    # config.action_mailer.perform_deliveries = true 
    config.action_mailer.delivery_method = :smtp 
    config.action_mailer.smtp_settings = { 
    address:    'smtp.gmail.com', 
    port:     '587', 
    domain:    'gmail.com', 
    tsl: true, 
    user_name:   '[email protected]', 
    password:    'password', 
    authentication:  :plain, 
    ssl: true, 
    enable_starttls_auto: true , 
    openssl_verify_mode: 'none' 
    } 

錯誤:所以SSL_connect返回= 1個錯誤號= 0狀態=的SSLv2/v3的讀取服務器問候答:未知協議

,當我在網上搜索,他們只是添加行「enable_starttls_auto:真,openssl_verify_mode :'無''將以錯誤結束,但它仍然沒有解決我的問題。

+0

你得到的答案? – Prem

回答

1

請試試這個:

ActionMailer::Base.smtp_settings = { 
    :address  => 'smtp.sendgrid.net', 
    :port   => '587', 
    :authentication => :plain, 
    :user_name  => ENV['SENDGRID_USERNAME'], 
    :password  => ENV['SENDGRID_PASSWORD'], 
    :domain   => 'heroku.com', 
    :enable_starttls_auto => true 

} 
+0

如果我這樣做,它會顯示錯誤:「Net :: ReadTimeout」 –

+0

這樣做的工作嗎?我也收到一個錯誤。 SSL_connect返回= 1 errno = 0狀態= SSLv2/v3讀取服務器hello A:未知協議 – olleh