开发者

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

开发者 https://www.devze.com 2023-02-02 06:40 出处:网络
Action Mailer is configured as follows in development.rb: config.action_mailer.delivery_method= :sendmail

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 suppos开发者_运维百科ed 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.


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>",
}


can't be the some domain where use the sendmail
so change the config in devise.rb

config.mailer_sender = "no-reply@other-domain.com"

check mail log below

tail -f /var/log/mail.log 

good luck

0

精彩评论

暂无评论...
验证码 换一张
取 消