Hi,

I'm trying to configure my sinatra app to send emails via Sendgrid.
Steps I have done so far:

require 'sinatra/base'
require 'action_mailer'

# my sinatra controller code

class MyMailer < ActionMailer::Base
  def email
      recipients "[email protected]"
      from         "[email protected]"
      subject    "test email"
      sent_on    Time.now
      body       "This is a test."
  end
end

MyMailer.deliver_email

The Heroku docs say, I don't need anything else beside this:

heroku addons:add sendgrid:basic

I was getting error (NilClass, NoMethodError in Heroku gem, def
format..) when  'heroku config'.

There were some recommendations to do this:

heroku addons:remove sendgrid:basic
heroku addons:add sendgrid:basic

'heroku config' now works fine. However, I'm still getting this error:

Errno::ECONNREFUSED: Connection refused - connect(2)

I tried to define the smtp arguments for ActionMailer manually
(extracted from the heroku config), however I got this error:
Errno::EAFNOSUPPORT: Address family not supported by protocol - socket
(2)

Am I missing something?
Please help.
Thanks.
v.

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to