I'm testing Devise authentication for Rails on my local host and want to get it to send emails for password retrieval (i.e. the "forgot your password" link). Password retrieval is built into Devise, it's just a matter of configuring it properly to get the email to send.
In initializers/devise.rb, I put
config.mailer_sender = "[email protected]"
but when I tried to test the "forgot your password" link on Devise authentication for rails I got the error message below. If I do need to add other information for the email to actually send, what do I need to add and where??
In users model, these are the modules that are being used devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
--- error message --- Errno::ECONNREFUSED in Devise::PasswordsController#create Connection refused - connect(2) Rails.root: /Users/myname/Sites/rails3d Application Trace | Framework Trace | Full Trace Request Parameters: {"utf8"=>"✓", "authenticity_token"=>"8oO5vXqO4esl3ztn5yE7OkVxZe+Ju94jj76rbKR225I=", "user"=>{"email"=>"[email protected]"}, "commit"=>"Send me reset password instructions"} Show session dump Show env dump Response Headers
Devise is an excellent authentication system made for Rails that allows us to easily drop-in User functionality into our project. Devise only includes an email and password for registration, let's also add our own username to our User model. We also want to have a unique index on our username.
HAve you setup your mail settings in environments/development.rb
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => 'domain.com',
:user_name => '[email protected]',
:password => 'password',
:authentication => :plain,
:enable_starttls_auto => true }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With