From: Minero Aoki Date: 2005-01-26T23:09:43+09:00 Subject: Re: Bug in open_message_stream of Net::SMTP? Hi, In mail "Bug in open_message_stream of Net::SMTP?" Lars Hoss wrote: > The following sample code doesn't work for me: > > Net::SMTP.start("smtp.mac.com", 25) do |smtp| > smtp.open_message_stream(from_addr, [to_addr]) do |f| > f.puts "Subject: test message" > f.puts > f.puts "This is a test message" > end > end > > This is the result: > I wonder where the empty lines after the "Original-recipient" come from? > Using send_message, however, works fine: Sorry, I forgot to backport a patch from 1.9. Use this patch: --- lib/net/protocol.rb 18 Aug 2004 14:42:04 -0000 1.73.2.1 +++ lib/net/protocol.rb 26 Jan 2005 14:06:47 -0000 @@ -403,7 +403,7 @@ end def puts( str = '' ) - write str.sub(/\n?/, "\n") + write str.chomp("\n") + "\n" end def printf( *args ) Regards, Minero Aoki