我试图解决它,但无济于事。请帮忙。
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@gmail.com',
password: 'password',
authentication: :plain,
ssl: true,
enable_starttls_auto: true ,
openssl_verify_mode: 'none'
}
错误:SSL_connect返回= 1 errno = 0状态= SSLv2 / v3读取服务器问候A:未知协议
当我在网上搜索时,他们只需添加一行" enable_starttls_auto:true,openssl_verify_mode:' none' "将以错误结束,但它仍然无法解决我的问题。
答案 0 :(得分: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
}