From: Satish Talim Date: 2006-07-31T10:39:01+09:00 Subject: Re: TCPSocket and RFC 821 ------=_Part_58912_17014145.1154309938149 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I tried the various suggestions given by Francis and Yohanes, but still it does not work. The executable code now is: require 'socket' t = TCPSocket.new('localhost', 25) puts t.gets t.puts "HELO Welcome from Ruby\r\n" puts t.gets t.puts "MAIL FROM:\r\n" puts t.gets t.puts "RCPT TO:\r\n" puts t.gets t.puts 'DATA' puts t.gets t.puts "Test email from ruby\r\n" t.puts "\r\n.\r\n" t.puts 'QUIT' puts t.gets t.close and the output is: >ruby email.rb 220 Welcome to the 1st SMTP Server 250 Hello Welcome from Ruby 250 satish_talim@yahoo.com Address Okay 250 satish.talim@gmail.com Address Okay 354 Start mail input; end with . nil >Exit code: 0 I'd appreciate any other suggestions. Incidentally, if I write a program using the Net::SMTP class, I am able to send off emails with my current configuration. On 7/31/06, Francis Cianfrocca wrote: > > Satish Talim wrote: > > t.puts 'DATA' > > puts t.gets > > t.puts 'Test Email from Ruby' > > t.puts "\r\n.\r\n" > > Ok, so obviously you're not sending a normal RFC-822 header here. Is it > possible that your SMTP server is so strict about this that it closes > the connection silently? > > -- > Posted via http://www.ruby-forum.com/. > > -- Satish Talim http://www.puneruby.com/blog/ ------=_Part_58912_17014145.1154309938149--