user1130176
user1130176

Reputation: 1878

Devise doesn't send mail in production

I can't seem to get devise to send the confirmation mail in production. No error in the log, and sendmail works fine. Here is my production config:

config.action_mailer.delivery_method = :sendmail
config.action_mailer.smtp_settings = {  
  :enable_starttls_auto => true,  #this is the important stuff!
  :address => "localhost",
  :port    => 25,
  :domain  => 'beautifulidiot.com',
  :openssl_verify_mode  => 'none',
  :perform_deliveries => true
}  

I've tried changing the delivery method to :smtp, also no luck. This is Rails 3.2.5.

Thanks for any help, Kevin

Upvotes: 2

Views: 1840

Answers (3)

Dinesh Saini
Dinesh Saini

Reputation: 2916

  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             => 'XXXX',
      :authentication       => 'plain',
      :enable_starttls_auto => true  
  }

and replace the credentials as per your one

Upvotes: 1

Gjaldon
Gjaldon

Reputation: 5644

The problem is that you set your delivery_method as :sendmail but you set settings for smtp. To fix your problem do either of the following:

Option 1:

config.action_mailer.delivery_method = :sendmail
config.action_mailer.send_mail_settings = { ... }

Option 2:

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { ... }

It looks like your settings are for :sendmail though, so better to try option 1 first.

Upvotes: 1

Helio Santos
Helio Santos

Reputation: 6805

try this:

config.action_mailer.perform_deliveries = true

and don't forget to restart the server

Upvotes: 0

Related Questions