Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise confirmation emails are not arriving. How do I properly configure it?

Action Mailer is configured as follows in development.rb:

config.action_mailer.delivery_method       = :sendmail
config.action_mailer.perform_deliveries    = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options   = { :host => 'localhost:3000' }

That is supposed to work according to Rails Guides and all extra info I managed to find on the internet. When I searched for my specific problem I mostly found solutions for SMTP configurations.

What am I missing?

Update:

All my emails are being delivered to /var/mail/root for some reason.

like image 650
Matheus Moreira Avatar asked Feb 25 '23 11:02

Matheus Moreira


1 Answers

On your development machine do you have the program 'sendmail' installed? Try this on the command line:

which sendmail

If I were you I'd not be sending email in development mode, but if you do want to do that, sign up for a gmail.com account and use this:

config.action_mailer.delivery_method = :smtp

config.action_mailer.smtp_settings = {
  :enable_starttls_auto => true,
  :address => "smtp.gmail.com",
  :port => 587,
  :domain => "gmail.com",
  :authentication => :login,
  :user_name => "<your username>@gmail.com",
  :password => "<your password>",
}
like image 196
stef Avatar answered Apr 08 '23 01:04

stef