From: Torsten Schmidt Date: 2005-11-12T22:29:36+09:00 Subject: Re: net/smtp question ------=_Part_5245_11436487.1131802173193 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thanks a lot Botp, all of this works :) Best Whishes, Torsten 2005/11/12, Pe=F1a, Botp : > > Torsten Schmidt [mailto:torstello@gmail.com] > > #Net::SMTP::start('server', 25) do |smtp| > #smtp.open_message_stream('ruby-smtp@Webcattest', > #[ 'my@email ] > #) do |stream| > #stream.puts "From: hallo@wach.de" > #stream.puts "To: Alle-die-es-angeht" > #stream.puts "Subject: Ruby-smtp-TEST" > #stream.puts "\nhallo von der Webcat=FCberwachung mit Ruby! \n\n" > #stream.puts "ErrorCode:" > #stream.puts error_code > #stream.puts "\n\nErrorMessage:" > #stream.puts error_message > #end > #end > > in windows, i have to replace "puts" with "write" and append all strings = i > write with "\r\n" and "\n" with "\r\n" > > it works (and i also tested your code) > > #This method (also from the docs) works (Sets the Subject > #correctly), but > #here i can't put values of variables into the message text (as > #i can see it) > # > #-------------- > #msgstr =3D < #From: Your Name > #To: Destination Address > #Subject: test message > # > #This is a test message. > #END_OF_MESSAGE > # > #Net::SMTP.start('exchange2000', 25) do |smtp| > #smtp.send_message msgstr, 'Ruby-smtp@test.de', 'myname@hallo.de' > #end > > > yes, you can. > > pls, research on "#{}" > > eg. > > C:\family\ruby>irb > irb(main):001:0> m=3D"botp@my.friend" > =3D> "botp@my.friend" > irb(main):002:0> string=3D"botp's address is #{m}" > =3D> "botp's address is botp@my.friend" > irb(main):003:0> > > hth. > kind regards -botp > > > > ------=_Part_5245_11436487.1131802173193--