Sending mail through gmail

Hi. Could someone give me an example of how to send mail through a gmail
account using the Ruby Net::SMTP class? Park H.'s gmailer library
doesn’t work for me.

Thanks

On 7/5/06, Ell Q. [email protected] wrote:

Hi. Could someone give me an example of how to send mail through a gmail
account using the Ruby Net::SMTP class? Park H.'s gmailer library
doesn’t work for me.

It’s probably better to figure out why gmailer isn’t working. I’m not
sure what you’d have to do for SASL support with gmail/SMTP.

-austin

On 06/07/06, Ell Q. [email protected] wrote:

Hi. Could someone give me an example of how to send mail through a gmail
account using the Ruby Net::SMTP class? Park H.'s gmailer library
doesn’t work for me.

I saw this the other day:

http://typo.onxen.info/articles/2006/06/27/activemailer-sending-via-gmail

It’s using ActionMailer, but I wonder if the same technique might work
in your case.

Paul.

Ell Q. wrote:

Hi. Could someone give me an example of how to send mail through a gmail
account using the Ruby Net::SMTP class? Park H.'s gmailer library
doesn’t work for me.

There’s a recent blog post by stoyan at Bloggitation on this topic just
here:
http://typo.onxen.info/articles/2006/06/27/activemailer-sending-via-gmail

Cheers,
Dave

Ell Q. wrote:

Hi. Could someone give me an example of how to send mail through a gmail
account using the Ruby Net::SMTP class? Park H.'s gmailer library
doesn’t work for me.

Thanks

may be you should check the SMTP port you provided; because gmail uses
port 587.

~sind

Ell Q. wrote:

Hi. Could someone give me an example of how to send mail through a gmail
account using the Ruby Net::SMTP class? Park H.'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: “<meta
http-equiv="content-type" content="text/html;charset=utf-8">”
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…

sindica wrote:

~sind

and it uses TLS for authentication

~sind