繁体   English   中英

Rails 4.2.1 Action Mailer不传递电子邮件

[英]Rails 4.2.1 Action mailer not delivering the emails

Actionmailer似乎没有传递我的电子邮件,我的应用程序处于生产环境中。 我的config / environments / production.rb中有以下设置

  config.action_mailer.delivery_method = :sendmail
  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.default_options = {from: 'noreply@domain.com'}
  config.action_mailer.default_url_options = { host: 'http://domain.com' }

发送邮件

UserMailer.welcome(self).deliver_now

Rails版本:4.2.1

在我的production.log中,没有显示错误,所有任务均已完成,并且在日志中显示了实际的邮件输出。

感谢名单!

尝试这个

config.action_mailer.delivery_method = :smtp

config.action_mailer.smtp_settings = {
     :address => "smtp.gmail.com",
     :port => 587,
     :user_name => "your mail",
     :password => "your password",
     :authentication => :plain,
     :enable_starttls_auto => true
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM