From: Jamey Cribbs Date: 2000-12-14T03:12:39+09:00 Subject: [ruby-talk:7165] Re: Hello and a question. Guy, it worked! I'm still not completely sure why it worked, but I am going to go over your email a few more times and try to figure out what's going on. A follow up question, if I may. Why couldn't I just say: smtp = Net::SMTP.new('130.102.202.23') I tried it but it doesn't work. What am I missing? Thanks very much for your help! Jamey. On Wednesday 13 December 2000 12:28, you wrote: > >>>>> "J" == Jamey Cribbs writes: > > J> smtp = Net::SMTP.new > J> smtp.start('130.102.202.23') > > When #start is a method it take arguments : > : start( helo_domain = Socket.gethostname, \ > > account = nil, password = nil, authtype = nil ) > > : start( helo_domain = Socket.gethostname, \ > > account = nil, password = nil, authtype = nil ) {|smtp| .... } > > When #start is a _class_ method (i.e. Net::SMTP.start) its syntax is > > : start( address = 'localhost', port = 25, *protoargs ) > : start( address = 'localhost', port = 25, *protoargs ) {|smtp| .... } > > is equal to Net::SMTP.new( address, port ).start( *protoargs ) > > > This mean that in your example it try to open the smtp server "localhost" > (no server was specified in #new) > > Try with > > smtp = Net::SMTP.start('130.102.202.23') > > > > Guy Decoux