From: Eric Hodel Date: 2011-11-02T07:56:52+09:00 Subject: Re: Ruby and Telnet On Nov 1, 2011, at 3:22 PM, Leo M. wrote: > Hello! > > I'm having problems with the library 'net/telnet'. > > What I'm trying to do is to re-create a normal telnet email session with > a smtp server. > > So, my question is : is it possible to reproduce the HELO, MAIL FROM, > RCPT TO etc in this Ruby module? > > What I tried to do is here below, and with this I receive correctly the > 220 message, but what I'm seeking is the 250! > > require 'net/telnet' > t = Net::Telnet::new( "Timeout" => 10, > "Prompt" => /%/, > "Host" => "gmail-smtp-in.l.google.com", > "Port" => 25 ) > t.login("*MY ACCOUNT*", "*MY PASSWORD*") {|str| print str} > t.cmd("HELO *MY ACCOUNT*") {|str| print str} > t.print("top") > process_string = t.waitfor(/\d+ processes/) > t.close > > Where am I mistaken? Why aren't you using net/smtp?