I am deploying an ruby-on-rails app in Heroku.I cannot add the SendGrid add-on to the heroku account.Is there any other ways to use the email services?
Can we use smtp with heroku without the SendGrid add-on?
1.1k views Asked by swetha pvl At
2
There are 2 answers
0
On
You could use your Gmail account.
In config > environment > production.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => 'gmail.com',
:user_name => ENV['GMAIL_USER_NAME'],
:password => ENV['GMAIL_PASSWORD'],
:authentication => 'plain',
:enable_starttls_auto => true
}
Then you have to set GMAIL_USER_NAME and GMAIL_PASSWORD to Heroku configs
GMAIL_USER_NAME should be your email address of gmail domain eg.
[email protected]
Yes you can simply sign up for a SendGrid account directly and then use the SMTP details. It would look like this:
There's also an example using the Mail gem, in the SendGrid documentation.