【发布时间】:2019-06-21 21:51:28
【问题描述】:
我在 Rails 的生产环境中使用 SMTP。
如果相关的话,我将使用deliver_later 发送电子邮件。
我收到以下错误:
E, [2019-01-28T20:13:35.610611 #63161] ERROR -- : [ActiveJob] [ActionMailer::DeliveryJob] [97578598-066d-46a0-b7fb-9daeb2eaf689] Error performing ActionMailer::DeliveryJob (Job ID: 97578598-066d-46a0-b7fb-9daeb2eaf689) from Async(mailers) in 1455.28ms: EOFError (end of file reached):
这是我的配置:
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => 'postal.<redacted>',
:port => '25',
:authentication => 'plain',
:user_name => '<redacted>'/main',
:password => '<redacted>''
}
config.action_mailer.perform_deliveries = true
config.action_mailer.default_url_options = { :host => '<redacted>'', :protocol => 'https' }
我对 Rails 还很陌生,因此我们将不胜感激。
我正在使用Ruby 2.3.7 和Rails 5.2.2。
其他关于堆栈溢出的类似帖子似乎没有解决这个问题。
【问题讨论】:
-
您是否使用 Rails 凭据来存储您的用户名和密码?
-
不,它们存储在
production.rb文件中。 -
您是否安装了 Sidekiq 或其他后台作业处理器来异步执行作业 (
deliver_later) ?您是否还尝试使用deliver_now发送电子邮件?在使交付异步之前可能是一个很好的第一次测试 -
你的意思是编辑
-
我不想透露的私人信息。
标签: ruby-on-rails ruby smtp