From: Torsten Schmidt Date: 2005-11-12T19:27:57+09:00 Subject: net/smtp question ------=_Part_4625_19821580.1131791263830 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi @all, Hi @all, i have a problem setting the From: Subject: und To: fields with net::SMTP i followed an example from the docs and also pickaxe_2 book: --------- 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 ----------- Output: Email-Body: ##### From: Ruby WebCat ALERT To: Alle-die-es angeht Subject: Ruby-smtp-TEST hallo von der Webcat=FCberwachung mit Ruby! ErrorCode: 404 ErrorMessage: /notvalidurl ##### i expected to see the Subject of the message not in the Email-Body, but in the header to display it in my email-client. 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 < 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 -------------- Could i either change the first method to set the subject or the second to include my variable-values? I'm just beginning with ruby so any hints are welcome. Best Regards, Torsten ------=_Part_4625_19821580.1131791263830--