Answer the question
In order to leave comments, you need to log in
Why is the password recovery not sent to the mail (Devise)?
Hello, I connected and configured the Devise gem initially. But sending a message to the mail does not work when trying to recover the password.
application.rb code
ActionMailer::Base.smtp_settings = {
:address => 'smtp.gmail.com',
:domain => 'mail.google.com',
:port => 587,
:user_name => ENV['почта@gmail.com'],
:password => ENV['пароль'],
:authentication => :login,
:enable_starttls_auto => true
}
config.action_mailer.default_url_options = { :host => "localhost" }
config.action_mailer.delivery_method = :smtp
Devise::Mailer#reset_password_instructions: processed outbound mail in 212.1ms
Sent mail to [email protected] (30007.4ms)
Date: Sat, 12 Mar 2016 14:49:31 +0200
From: [email protected]
Reply-To: [email protected]
To: [email protected]
Message-ID: <[email protected]>
Subject: Reset password instructions
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<p>Hello [email protected]!</p>
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
<p><a href="http://localhost/users/password/edit?reset_password_token=L3A6c7mtnPzWdxqfNs9L">Change my password</a></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>
Redirected to http://localhost:3000/users/sign_in
Completed 302 Found in 30475ms (ActiveRecord: 19.3ms)
Answer the question
In order to leave comments, you need to log in
config.action_mailer.default_options = { from: 'твой email' }
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
user_name: 'твой email',
password: 'пароль созданный для gmail app',
authentication: 'login',
enable_starttls_auto: true
}
To send from localhost, you need to dance with a tambourine. Somewhere on the open spaces of stackoverflow even the question "what the hell is a button accordion for a goat?" Deploy and it should be ok... And so you got a letter in the console. Actually, what more do you need from development?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question