From: Kevin Smith Date: 2000-12-14T11:31:43+09:00 Subject: [ruby-talk:7188] Re: Sending SMTP (was: Re: Hello and a question.) >Kevin Smith writes: > >> > Net::SMTP.start(server) do |smtp| >> > smtp.sendmail(message, from, [ to ]) >> > end >> > >> Thanks for the tip. My original implementation assumed that message >> was an array, not a string. I rewrote it using your approach, and >> using a string with "\n" terminated lines, and it seems to work >> fine. > >In fact you could have left it as an array of lines. It would respond >to #each by returning each line, which would then be written by >sendmail. I tried that, but my array lines did *not* get newlines attached, so my server mangled the message. Not sure why. Not an issue since converting it to a string worked fine. Kevin