【发布时间】:2013-10-10 06:57:11
【问题描述】:
使用 gmail 帐户作为“发送地址”开发的 Rails 3.2.8 应用程序。 当邮件发送工作时,我的 environment.rb 文件包含以下内容:
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "gmail.com",
:authentication => :login,
:user_name => "accountname",
:password => "123456789"
}
我在我的应用程序日志中收到此消息: EOFError(到达文件末尾): 当上面的代码改为如下所示:
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "mail.company.com",
:port => 25,
:domain => "company.com",
:authentication => :login,
:user_name => "accountname",
:password => "123456789"
}
我可以告诉你我 - 能够向电子邮件地址发送手动电子邮件 并在使用 ThunderBird 等电子邮件客户端时看到它,因此我知道 accountname@company.com 正常运行。
我不明白文件结束错误是如何起作用的。 我也不知道如何让更多信息出现在日志中。
我期待阅读一些关于确定文件结束原因的建议。
Started POST "/sendInvites?locale=en&lot_id=18&user_id=17" for 99.99.99.99 at 2013-10-03 08:52:09 -0700
Processing by WaitingListsController#sendInvites as HTML
Parameters: {"authenticity_token"=>"uwz/6pW1rLPXR4gU3m3OwCmU0O3DSJ/haNM2/ai+OR8=", "locale"=>"en", "lot_id"=>"18", "user_id"=>"17"}
=======>>>> Beginning Send Invitation Process <<<<=======
=======>>>> just before the PassEmailer.requestApprovedWL IS called to send the invitation <<<<=======
>>>> Beginning ::: requestApprovedWL(user_info) <<<<=======
Rendered pass_emailer/requestApprovedWL.erb (0.9ms)
>>>> at the end of ::: requestApprovedWL(user_info) <<<<=======
Completed 500 Internal Server Error in 1718ms
EOFError (end of file reached):
app/controllers/waiting_lists_controller.rb:276:in `sendInvites'
【问题讨论】:
-
在讨论错误时,请始终粘贴整个错误跟踪。请将整个错误添加到您的帖子中。
-
当我没有在后台运行
mailcatcher时,我刚刚在开发中遇到了这个错误。有点莫名其妙。 -
你不是唯一一个。很遗憾没有解决方案。
标签: ruby-on-rails email actionmailer