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''
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:436:in
`perform_delivery_smtp''
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:327:in
`send''
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:327:in
`deliver!''
c:/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.1.5/lib/action_mailer/base.rb:254:in
`deliver''
#{RAILS_ROOT}app/controllers/order_controller.rb:11:in `confirm''
--
Posted via http://www.ruby-forum.com/.
I think this is a problem of environment.rb. But when I try to run the sample code of book "Agile Web Development by Ruby on Rails final", it can''t work either. -- Posted via http://www.ruby-forum.com/.
Hello
I tried answering this problem on different thread:
http://www.ruby-forum.com/topic/53991#32200
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: <from@server.com>
To: <to@server.com>
Subject: Test
Date: #{Time.now}
Test
END_OF_MESSAGE
Net::SMTP.start(''smtp.server.com'', 25,
''server.com'', ''from'',
''secret_password'', :plain ) do |smtp|
smtp.send_message msgstr,
''from@server.com'',
''to@server.com''
end
--end of sample code--
My smtp server was checking whether ''from@server.com'' 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).
--
Posted via http://www.ruby-forum.com/.