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
}