Configuration for mailjet email delivery with Ruby on Rails

Setting up to deliver your mail via Ruby on Rails? Here's how, because their Getting Started is nothing but placeholder headers right now.

Mailjet : Real-time Emailing -

Create an account

Go to and create an account.

Note: the word "Faculatative" means "optional" on the signup form.

Add your sending address

  • Add a sending address (Accounts > Sender Addresses)
  • Update your Rails ActionMailer configuration
    • Find the settings you need at:
                  SMTP server: 
                  Username (API Key): 
                  Password (Secret Key): 
                  25 or 587 (some providers block port 25)
                  Use TLS: 
    • Set these settings in config/application.rb (or config/environments/production.rb):
                  config.action_mailer.raise_delivery_errors = false
                  config.action_mailer.perform_deliveries = true
                  config.action_mailer.smtp_settings = {
                    :address => "",
                    :enable_starttls_auto => true,
                    :port => 587,
                    :authentication => 'plain',
                    :user_name => "12345678901234567890",
                    :password => "99999999999999999999999999999999"

Setup domain authentication (SPF and/or DomainKeys/DKIM)


My Account -
Click Domain DNS and SMTP setup.
Then, under Domain Authentication, click your domain.

Setting up SPF requires adding a DNS entry. Mailjet will look at your existing one and give you the one to replace it with. It'll look something like: IN TXT "v=spf1 mx ~all"
In my DNS manager, I created a TXT record, gave it a name of "" and set the value to the
'v=spf1 mx ~all' portion (without the quotes). The full example they give you is for the DNS zone syntax, which you may or may not have.

If you need help configuring this, we would be happy to help you.


This is similar, a TXT record that has a key that identifies your server so mail can be sent. Same deal.


Deploy your changes and kick off something that sends a mailer. We have a Notifier model that has a test_email() method that I just called from the console to push a test through. I just went to the reports and saw it there.

All in all, the service seems a little rough around the edges, mostly due to it being a French company that could use a little work on the translations and some serious love on the support documentations. Hope this helps you get started with Mailjet configuration!

Established 2005 · Databasically © 2016