无法使用rails发送邮件获取EOFError

时间:2013-11-27 18:22:18

标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-4

以下是我收到的错误消息

Sent mail to my-mail-id@gmail.com (1038.2ms)
I, [2013-11-27T17:52:14.322298 #2530]  INFO -- : Completed 500 Internal Server Error in 1061ms
F, [2013-11-27T17:52:14.324840 #2530] FATAL -- : 
EOFError (end of file reached):
  app/controllers/contacts_controller.rb:15:in `create'

在上面提到的sent mail消息中,但我没有收到邮件。

contacts_controller.rb第15行我有

def create
    @contact = Contact.new contact_params
    unless contact_params.nil?
        if @contact.save
            ContactMailer.contact_seller.deliver # this is line 15
        end
    end
    render nothing: true
end

我的contact_mailer.rb是

class ContactMailer < ActionMailer::Base
  default from: "admin@domain.com"

  # Subject can be set in your I18n file at config/locales/en.yml
  # with the following lookup:
  #
  #   en.contact_mailer.contact_seller.subject
  #
  def contact_seller
    @greeting = "Hi"

    mail to: "my-mail-id@gmail.com"
  end
end

0 个答案:

没有答案