Rails beginner
Rails beginner

Reputation: 14504

Heroku actionmailer how to

I am trying to create an email adress. I have added the sendgrid plugin to my app.

Here is my application.rb

module Konkurranceportalen
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    #  all .rb files in that directory are automatically loaded.
    config.action_mailer.delivery_method = :smtp
    ActionMailer::Base.smtp_settings = {
  :address  => "smtp.mydomain.com",
  :port  => 25,
  :user_name  => "[email protected]",
  :password  => "mypass",
  :authentication  => :login
}
end
end

Upvotes: 0

Views: 1988

Answers (3)

John Beynon
John Beynon

Reputation: 37507

that doesn't look like the code you need to use SendGrid with on Heroku - the docs have all the details you need, here

Upvotes: 0

Rails beginner
Rails beginner

Reputation: 14504

To create an regular email like [email protected] you need an Mail Exhange host.

When you have choicen your mail exhange host you can create emails like [email protected]

Now you need to setup the Mx record on you DNS server

And vola you have a email like [email protected]

Upvotes: 0

Markus Proske
Markus Proske

Reputation: 3366

You need to change your settings for Sendgrid:

 ActionMailer::Base.smtp_settings = {
  :address        => "smtp.sendgrid.net",
  :port           => "25",
  :authentication => :plain,
  :user_name      => ENV['SENDGRID_USERNAME'],
  :password       => ENV['SENDGRID_PASSWORD'],
  :domain         => ENV['SENDGRID_DOMAIN']

Upvotes: 1

Related Questions