Send an Email to Padrino in Heroku

I am trying to send emails via sendmail in Padrino. I made the configuration indicated here ( Configuration and Quick Use )

But I always get the following error in the server log (on Heroku or localhost):

app[web.1]: sh: Illegal option - 
app[web.1]: Errno::EPIPE - Broken pipe:

I installed mail gemand I use Padrino 0.10.7

I use this to send an email:

post :create do
  email(:from => "tony@reyes.com", :to => "john@smith.com", :subject => "Welcome!", :body=>"Body")
end

That’s almost everything I have ...

+5
source share
2 answers

You must use one of the passwords to send mail from Heroku.

A good option is Sendgrid

heroku addons:add sendgrid:starter --app=your_app_name

Then in your Padrino app in app.rb inside your App class:

set :delivery_method, :smtp => { 
  :address              => "smtp.sendgrid.net",
  :port                 => 587,
  :domain               => 'heroku.com',
  :user_name            => ENV['SENDGRID_USERNAME'],
  :password             => ENV['SENDGRID_PASSWORD'],
  :authentication       => :plain,
  :enable_starttls_auto => true  
}

SMTP- Mandrill .

, Errno:: EPIPE, , , SMTP-, , .

+5

, , app.rb, stef, . , , gmail, :

  set :delivery_method, :smtp => {
    :address              => "smtp.domain.com",
    :port                 => 587,
    :domain               => 'rails.domain.com',
    :user_name            => "rails@domain.com",
    :password             => "super-secret",
    :authentication       => "plain",
    :enable_starttls_auto => true,
    :openssl_verify_mode  => OpenSSL::SSL::VERIFY_NONE
  }
0

All Articles