Pony.mail({ :to => 'y...@example.com', :via => :smtp, :via_options => { :address => 'smtp.gmail.com', :port => '587', :enable_starttls_auto => true, :user_name => 'user', :password => 'password', :authentication => :plain, # :plain, :login, :cram_md5, no auth by default :domain => "localhost.localdomain" # the HELO domain provided by the client to the server } })
--
---
You received this message because you are subscribed to the Google Groups "Ponyrb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ponyrb+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Sam,You probably have to use gmail's smtp servers, not your local machine. Something like this:Pony.mail({ :to => 'y...@example.com', :via => :smtp, :via_options => { :address => 'smtp.gmail.com', :port => '587', :enable_starttls_auto => true, :user_name => 'user', :password => 'password', :authentication => :plain, # :plain, :login, :cram_md5, no auth by default :domain => "localhost.localdomain" # the HELO domain provided by the client to the server } })
On Mon, Aug 12, 2013 at 8:45 AM, Sam D. <thisisbeau...@gmail.com> wrote:
Hi Ben,I just found the express way to send emails using Pony in 1 line and thus, tried using it the following way: The test passed with no error but didn't receive any eI'm using maildescribe 'Test Example'it 'sends email' do
Pony.mail(:from => 'thisisbe...@gmail.com', :to => 'thisisbe...@gmail.com', :via => :sendmail, :subject => 'hi', :body => 'hello world')
endendAnd, the test fails on using :via => smtp, giving any error : "Errno::ECONNREFUSED: Connection refused - connect(2)"I'm using Rubymine IDE with RSpec (2.0.5) framework on Mac OS X Mountain Lion.My Ruby version is 2.0.0Can you please suggest if I'm missing some steps to use Pony?ThanksSam