From: Dave Thomas Date: 2000-12-14T03:52:36+09:00 Subject: [ruby-talk:7170] Re: Sending SMTP (was: Re: Hello and a question.) Kevin Smith writes: > Here's my SMTP code (that works): > > smtp = Net::SMTP.start('mail.server.whatever') > smtp.ready(from, to) do > | a | > message.each do > | line | > a.write(x + "\r\n") > $stdout.write(x + "\r\n") #debugging > end > end In fact, that can be even simpler (but without the debugging) using Net::SMTP.start(server) do |smtp| smtp.sendmail(message, from, [ to ]) end Down in the guts of protocol.rb the code will add \r\n to lines that are missing them. All 'message' has to do is respond to 'each'. Regards Dave