Forum: Ruby on Rails EOF ERROR occurs when sending mail by ROR

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Xuefeng W. (Guest)
on 2006-01-08 10:10
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:in `rbuf_fill'
c:/ruby/lib/ruby/1.8/net/protocol.rb:196:in `timeout'
c:/ruby/lib/ruby/1.8/timeout.rb:55:in `timeout'
c:/ruby/lib/ruby/1.8/net/protocol.rb:196:in `rbuf_fill'
c:/ruby/lib/ruby/1.8/net/protocol.rb:160:in `readuntil'
c:/ruby/lib/ruby/1.8/net/protocol.rb:171:in `readline'
c:/ruby/lib/ruby/1.8/net/smtp.rb:664:in `recv_response'
c:/ruby/lib/ruby/1.8/net/smtp.rb:396:in `do_start'
c:/ruby/lib/ruby/1.8/net/smtp.rb:396:in `critical'
c:/ruby/lib/ruby/1.8/net/smtp.rb:396:in `do_start'
c:/ruby/lib/ruby/1.8/net/smtp.rb:378:in `start'
c:/ruby/lib/ruby/1.8/net/smtp.rb:316:in `start'
#{RAILS_ROOT}app/controllers/order_controller.rb:11:in `confirm'
Xuefeng W. (Guest)
on 2006-01-09 03:08
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.
Michal Wronka (Guest)
on 2006-07-08 21:04

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: <removed_email_address@domain.invalid>
To: <removed_email_address@domain.invalid>
Subject: Test
Date: #{}


Net::SMTP.start('', 25, '', 'from',
'secret_password', :plain ) do |smtp|
  smtp.send_message msgstr,
--end of sample code--

My smtp server was checking whether 'removed_email_address@domain.invalid' 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).
This topic is locked and can not be replied to.