使用 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'