Reputation: 65
I have tried to fix it but to no avail. Please help.
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'
}
Error: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol
when I search on the net, they just add the line "enable_starttls_auto: true, openssl_verify_mode: 'none' " will end in error, but it still did not solve my problem.
Upvotes: 0
Views: 3639
Reputation: 381
Please try this :
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
}
Upvotes: 2