M
M
Max2016-03-13 19:06:05
Ruby on Rails
Max, 2016-03-13 19:06:05

How to set up mail forwarding (Devise, Heroku)?

Hello, I started a project on Heroku. I'm trying to set up to start sending a password recovery email to the mail, but nothing comes out. Displays the error "We're sorry, but something went wrong."
production.rb file

config.action_mailer.delivery_method = :smtp 
  config.action_mailer.perform_deliveries = true
  config.action_mailer.default_options = { from: 'моя почта' }
  config.action_mailer.default_url_options = { :host => 'cinema-booking.herokuapp.com' }
  config.action_mailer.smtp_settings = {
        :address        => 'smtp.gmail.com',
        :domain         => 'gmail.com',
        :port           => 587,
        :user_name      => ENV['моя почта'],
        :password       => ENV['полученый пароль'],
        :authentication => :plain
        :enable_starttls_auto => true
  }
  config.action_mailer.raise_delivery_errors = true

Added to initialize/devise.rb
config.mailer_sender = "моя почта"
What else do you need? Already searched the whole google

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2016-03-13
@maxprof

In principle, almost everything is correct.
There is only a misunderstanding of what ENV is and how to use it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question