Can't send email using Gmail on Heroku

后端 未结 1 728
[愿得一人]
[愿得一人] 2021-01-22 17:28

I can\'t get my Rails app to send emails using Gmail. I can send emails on my local development environment but I can\'t send it from Heroku. This is my config file.

app

相关标签:
1条回答
  • 2021-01-22 17:57

    This is an active app I have had forever where the mail still works. Try changing the auth type to a symbol rather than a string. So :plain instead of 'plain'.

      config.action_mailer.smtp_settings = {
        :enable_starttls_auto => true,
        :address => 'smtp.gmail.com',
        :port => 587,
        :authentication => :plain,
        :domain => 'blarg.com',
        :user_name => 'info@blarge.com',
        :password => 'password'
      }
    
     config.action_mailer.default_url_options = { :host => 'blarg.heroku.com' }
      config.action_mailer.delivery_method = :smtp
      config.action_mailer.perform_deliveries = true
      config.action_mailer.raise_delivery_errors = true
      config.action_mailer.default :charset => "utf-8"
    
    0 讨论(0)
提交回复
热议问题