I am using devise for authentication. It provides a forgot password link. When i send email then the email is not sent. Following is the settings i have used. Can you tell me why gmail is not sending the email? I have also turned on "allow less secure app to send email" and i have also enabled imap in gmail setting.
application.rb has the following setting.
ActionMailer::Base.smtp_settings = {
:address => 'smtp.gmail.com',
:domain => 'mail.google.com',
:port => 587,
:user_name => 'validemail@gmail.com',
:password => 'validpassword',
:authentication => 'login',
:enable_starttls_auto => true
}
development.rb has
config.action_mailer.default_url_options = { host: '127.0.0.1'}
config.action_mailer.delivery_method = :smtp
After sending the email i get the following text in the console.
Devise::Mailer#reset_password_instructions: processed outbound mail in 215.2ms
Sent mail to validemail@gmail.com (1097.6ms)
Date: Thu, 29 Dec 2016 09:50:41 +0000
From: please-change-me-at-config-initializers-devise@example.com
Reply-To: please-change-me-at-config-initializers-devise@example.com
To: validemail@gmail.com
Message-ID: <5864dc7161acb_173921a07788707d@kofhearts-rubyonrails-3267120.mail>
Subject: Reset password instructions
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<p>Hello validemail@gmail.com!</p>
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
<p><a href="http://127.0.0.1/users/password/edit?reset_password_token=WQxYad91mPghMxaurYA5">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 https://rubyonrails-kofhearts.c9users.io/users/sign_in
Completed 302 Found in 1965ms (ActiveRecord: 14.7ms)
UPDATE:
I am just following this tutorial.
https://www.youtube.com/watch?v=ZEk0Jp2dThc
Send email is not working with the settings that are specified in this video.