Pony and gmail

749 views
Skip to first unread message

DAZ

unread,
Aug 19, 2009, 3:41:45 AM8/19/09
to sinatrarb
What's the easiest way to give Pony a trial run out?

I'm trying to send a test email to myself, using my gmail account on
my local machine, but am struggling to get the settings right. I've
found this page:
http://mail.google.com/support/bin/answer.py?hl=en&answer=13287

And from that I have the following settings:
post '/contact' do
Pony.mail :to => 'd...@gmail.com',:from => 'd...@gmail.com'
:via => :smtp, :smtp => {
:host => 'smtp.gmail.com',
:port => '465',
:user => 'd...@gmail.com',
:pass => 'mypasswordj',
:auth => :login
:domain => "localhost.localdomain" # the HELO domain provided by
the client to the server
}
:subject => params[:subject]
"message sent!"
end

I'm not sure about the :auth and :domain settings. Anybody got this to
work or know how to, or is there an easier way?

Thanks,

DAZ

Ben Lovell

unread,
Aug 19, 2009, 5:03:27 AM8/19/09
to sina...@googlegroups.com
2009/8/19 DAZ <daz...@gmail.com>
My understanding of Gmail is you need to use a TLS connection to send from. Does pony support TLS?

Ben 

DAZ

unread,
Aug 19, 2009, 6:02:36 AM8/19/09
to sinatrarb
hmmm, I'm not sure. There seems to be a fork here that implies it
doesn't:
http://github.com/hiroshi/pony/tree/master

It also seems to imply that I might need another gem:
gem install smtp_tls

Is there an easier way to just test Pony out? Is there a simple way if
I deploy the app to Heroku?

cheers,

DAZ



On Aug 19, 10:03 am, Ben Lovell <benjamin.lov...@gmail.com> wrote:
> 2009/8/19 DAZ <daz4...@gmail.com>
>
>
>
>
>
> > What's the easiest way to give Pony a trial run out?
>
> > I'm trying to send a test email to myself, using my gmail account on
> > my local machine, but am struggling to get the settings right. I've
> > found this page:
> >http://mail.google.com/support/bin/answer.py?hl=en&answer=13287
>
> > And from that I have the following settings:
> > post '/contact' do
> >  Pony.mail :to => '...@gmail.com',:from => '...@gmail.com'
> > :via => :smtp, :smtp => {
> >    :host   => 'smtp.gmail.com',
> >    :port   => '465',
> >    :user   => '...@gmail.com',

Ben Lovell

unread,
Aug 19, 2009, 6:20:27 AM8/19/09
to sina...@googlegroups.com
2009/8/19 DAZ <daz...@gmail.com>

hmmm, I'm not sure. There seems to be a fork here that implies it
doesn't:
http://github.com/hiroshi/pony/tree/master

It also seems to imply that I might need another gem:
gem install smtp_tls

Install and require that gem and configure the mailer with port 587 and give that a try?
 

Is there an easier way to just test Pony out? Is there a simple way if
I deploy the app to Heroku?

I think heroku apps need to be "blessed" to communicate with external systems/services. I'm not sure if this is still the case however.
 

cheers,

DAZ


Cheers,
B

beenimble

unread,
Aug 19, 2009, 8:10:53 AM8/19/09
to sinatrarb
Yeah, you need smtp_tls and it should work with Ruby 1.8. My settings
were similar to yours except for the port (587, though it appears from
your link that 465 should also work).

Here's another option:

http://www.jamesbritt.com/2007/12/18/sending-mail-through-gmail-with-ruby-s-net-smtp

With Ruby 1.9.1 Pony stopped working due to a TMail issue. I don't
know if TMail's since been fixed, but Ruby 1.9's SMTP library added
TLS support via 'enable_starttls_auto' so you can just set that when
sending your message and remove all the extra libraries.
Reply all
Reply to author
Forward
0 new messages