From: Kevin Smith Date: 2000-12-14T03:40:10+09:00 Subject: [ruby-talk:7169] Sending SMTP (was: Re: Hello and a question.) >Hi! �I'm extremely new to Ruby. �I come mainly from a Perl background, with >about a zillion other languages thrown in. �:) �I bought "Programming Ruby" >(excellent book, so far) and am working my way through it. > >I am attempting to send an email via SMTP. �I am doing the following code: > >require 'net/smtp' >smtp = Net::SMTP.new >smtp.start('130.102.202.23') > >But I get a "Connection refused - connect(2)". > >The SMTP port on our email server is 25 ( I have even tried specifying that) >and I have tried a bunch of different angles on this. �I can connect using >Perl, Rebol, etc. > >Does anyone have an idea what I am doing wrong? 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 Kevin