I also ran into the same problem and fixed it by adding the following:
configurations / environment.rb
ActionMailer::Base.smtp_settings = { :address => "smtp.sendgrid.net", :domain => DOMAIN, :user_name => ENV['SENDGRID_USERNAME'], :password => ENV['SENDGRID_PASSWORD'], :authentication => "plain", :enable_starttls_auto => true } ActionMailer::Base.default_url_options = { host: 'mysite.mydomain.com' }
config / application.rb
ActionMailer::Base.delivery_method = :smtp
The letter_opener letter is very useful if you want to test sending emails in design mode. If you want to overwrite letter_opener, add the following configuration
configurations / environment / development.rb
ActionMailer::Base.delivery_method= :letter_opener
And also add the port in ActionMailer :: Base.smtp_settings.
source share