EOF ERROR occurs when sending mail by ROR

I meet an EOF ERROR when I try to send a mail by Mailer class. This is
my error information. Could you please kindly tell me the reason for it
and how to deal with it. Thank you.

EOFError in Order#confirm

End of file reached

RAILS_ROOT: ./script/…/config/…/
Application Trace | Framework Trace | Full Trace

c:/ruby/lib/ruby/1.8/net/protocol.rb:197:in sysread' c:/ruby/lib/ruby/1.8/net/protocol.rb:197:inrbuf_fill’
c:/ruby/lib/ruby/1.8/net/protocol.rb:196:in timeout' c:/ruby/lib/ruby/1.8/timeout.rb:55:intimeout’
c:/ruby/lib/ruby/1.8/net/protocol.rb:196:in rbuf_fill' c:/ruby/lib/ruby/1.8/net/protocol.rb:160:inreaduntil’
c:/ruby/lib/ruby/1.8/net/protocol.rb:171:in readline' c:/ruby/lib/ruby/1.8/net/smtp.rb:664:inrecv_response’
c:/ruby/lib/ruby/1.8/net/smtp.rb:396:in do_start' c:/ruby/lib/ruby/1.8/net/smtp.rb:396:incritical’
c:/ruby/lib/ruby/1.8/net/smtp.rb:396:in do_start' c:/ruby/lib/ruby/1.8/net/smtp.rb:378:instart’
c:/ruby/lib/ruby/1.8/net/smtp.rb:316:in start' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:436:inperform_delivery_smtp’
send' c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:327:indeliver!’
deliver' #{RAILS_ROOT}app/controllers/order_controller.rb:11:inconfirm’

I think this is a problem of environment.rb. But when I try to run the
sample code of book “Agile Web D. by Ruby on Rails final”, it
can’t work either.


I tried answering this problem on different thread:

In any case, try sending email directly via smtp to check your
configuration (for example by running code below)
–sample code–
msgstr = <<END_OF_MESSAGE
From: [email protected]
To: [email protected]
Subject: Test
Date: #{Time.now}


Net::SMTP.start(‘smtp.server.com’, 25, ‘server.com’, ‘from’,
‘secret_password’, :plain ) do |smtp|
smtp.send_message msgstr,
[email protected]’,
[email protected]
–end of sample code–

My smtp server was checking whether ‘[email protected]’ was the same in
all places , as shown in code above. If ‘From’ field in the mail was
different - EOFError was raised. (More details in the other thread).