Jett Hsieh
Jett Hsieh

Reputation: 3159

Where is the log about Devise send confirmation email?

I just config email settings and try to sign up a new account in my app.

It should send confirmation email but there is nothing happened and there is no error shown.

Where could I get logs to see if there is any problem in my configuration files?

The following is also my config in development.rb

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address              => "smtp.gmail.com",
:port                 => 587,
:domain               => 'mail.google.com',
:user_name            => '[email protected]',
:password             => 'password',
:authentication       => 'plain',
:enable_starttls_auto => true  }

Edited, newest config is as following:

config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => 'smtp.gmail.com:587' }

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address              => "smtp.gmail.com",
:port                 => 587,
:user_name            => "[email protected]",
:password             => "password",
:domain               => "gmail.com",
:authentication       => :login }

Upvotes: 0

Views: 539

Answers (1)

dexter
dexter

Reputation: 13583

You did not specify if you had configured the default_url_options

config.action_mailer.default_url_options = { :host => 'example.com' }

If you are testing in development and your log level is debug, action_mailer will display something like this in the log:

Sent mail to [email protected]

From: [email protected]
To: [email protected]
Subject: You have been registered with example.com
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8

....blah blah blah...

EDIT: I see too many things changing between your two mail configurations. So, posting mine for reference

config.action_mailer.default_url_options = { :host => 'example.com' }
config.action_mailer.smtp_settings = {
      :address              => "smtp.gmail.com",
      :port                 => 587,
      :user_name            => '[email protected]',
      :password             => 'password',
      :authentication       => 'plain',
      :enable_starttls_auto => true  }

Upvotes: 1

Related Questions