From: Ell Quing Date: 2006-07-07T05:06:18+09:00 Subject: Re: sending mail through gmail Ell Quing wrote: > Hi. Could someone give me an example of how to send mail through a gmail > account using the Ruby Net::SMTP class? Park Heesob's gmailer library > doesn't work for me. > > Thanks I'm just trying to write some normal Ruby code (i.e., not Rails), though, so should I be trying to use ActionMailer? If not, and I can just use the Net::SMTP library, I'm not sure what I do here: Net::SMTP.start('your.smtp.server', 25, 'mail.from.domain', 'Your Account', 'Your Password', :login) Is it just Net::SMTP.start('smtp.gmail.com', 587, 'gmail.com', 'ellquing', 'mypassword, :login)? (The main problem is I don't know what to put in the 'mail.from.domain'--I know absolutely nothing about mail servers or whatnot.) Also, for those curious, the problem with the gmailer library is that I used to be able to use it to receive and send mail...but then one day, I'm not sure why, I got the following error when trying to login to any of my accounts: > g = GMailer.connect( "ellquing", "mypassword" ) Net::HTTPBadResponse: wrong status line: "" from /usr/lib/ruby/1.8/net/http.rb:1556:in `read_status_line' from /usr/lib/ruby/1.8/net/http.rb:1538:in `read_new' from /usr/lib/ruby/1.8/net/http.rb:833:in `request' from /usr/lib/ruby/1.8/net/http.rb:615:in `get' from ./gmailer.rb:196:in `connect_no_cookie' from ./gmailer.rb:195:in `start' from ./gmailer.rb:195:in `connect_no_cookie' from ./gmailer.rb:123:in `initialize' from ./gmailer.rb:1767:in `new' from ./gmailer.rb:1767:in `connect' from (irb):2 However, I then proceeded to create a new GMail account, and I was able to login fine... -- Posted via http://www.ruby-forum.com/.