title: Ruby mailer is coming up with an EOFError
body: <p>I am getting an EOFError (End Of File Error) on this code in my controller.  The block where the error appears is at the end of the line that says <code>UserMailer.deliver_message(</code> I am unaware as to how to fix this, I have been stuck for about 2  months and this site was suggested. Please help.</p>
  
  <pre><code>  def contact
        @title= "Contact Us"
        if request.post?
         @message= Message.new(params[:contact])
          if @message.valid?
             UserMailer.deliver_message(
              :message =&gt; @message
              )
            flash[:notice] = "Thank you for contacting us"
            redirect_to contact_url
           end
          end
        end
  </code></pre>
  
  <p>Here is the message file:</p>
  
  <pre><code>&lt;%= @message.name %&gt; has sent feedback or a question:
  
    Message: &lt;%= @message.body %&gt;
  
    From: &lt;%= @message.email %&gt;
  </code></pre>
  
  <p>And here is the UserMailer</p>
  
  <pre><code>class UserMailer &lt; ActionMailer::Base
  
    def message(mail)
      subject    'Feedback/Questions'
      recipients 'Email@email'
      from       'webmaster'
      body        mail
    end
  end
  </code></pre>
  
  <p>Alright here is the error I get</p>
  
  <hr>
  
  <p>EOFError in PedalsController#contact</p>
  
  <p>end of file reached</p>
  
  <hr>
  
  <p>and here is the application trace</p>
  
  <hr>
  
  <pre><code>/usr/lib64/ruby/1.8/net/protocol.rb:135:in `sysread'
  /usr/lib64/ruby/1.8/net/protocol.rb:135:in `rbuf_fill'
  /usr/lib64/ruby/1.8/timeout.rb:62:in `timeout'
  /usr/lib64/ruby/1.8/timeout.rb:93:in `timeout'
  /usr/lib64/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'
  /usr/lib64/ruby/1.8/net/protocol.rb:116:in `readuntil'
  /usr/lib64/ruby/1.8/net/protocol.rb:126:in `readline'
  /usr/lib64/ruby/1.8/net/smtp.rb:911:in `recv_response'
  /usr/lib64/ruby/1.8/net/smtp.rb:897:in `getok'
  /usr/lib64/ruby/1.8/net/smtp.rb:921:in `critical'
  /usr/lib64/ruby/1.8/net/smtp.rb:895:in `getok'
  /usr/lib64/ruby/1.8/net/smtp.rb:828:in `mailfrom'
  /usr/lib64/ruby/1.8/net/smtp.rb:653:in `sendmail'
  $HOME/blueflower/vendor/rails/actionmailer/lib/action_mailer/base.rb:684:in `perform_delivery_smtp'
  /usr/lib64/ruby/1.8/net/smtp.rb:526:in `start'
  $HOME/blueflower/vendor/rails/actionmailer/lib/action_mailer/base.rb:682:in `perform_delivery_smtp'
  $HOME/blueflower/vendor/rails/actionmailer/lib/action_mailer/base.rb:523:in `__send__'
  $HOME/blueflower/vendor/rails/actionmailer/lib/action_mailer/base.rb:523:in `deliver!'
  $HOME/blueflower/vendor/rails/actionmailer/lib/action_mailer/base.rb:395:in `method_missing'
  $HOME/blueflower/app/controllers/pedals_controller.rb:36:in `contact'
  </code></pre>
  
  <hr>
  
  <p>Maybe I am missing something really stupid, but if someone can answer this, that would be amazing.  Also, what is my fix?</p>