Ruby on Rails
Set Action Mailer's SMTP settings to route your Rails app's mail through Unitpost.
What are the SMTP settings?
| Host | smtp.unitpost.com |
|---|---|
| Username | unitpost(always this literal value) |
| Password | Your Unitpost API key(must carry emails:send) |
| Port (STARTTLS) | 587(or 2587 if blocked) |
| Port (implicit TLS) | 465(or 2465 if blocked) |
| From address | Any address on a verified domain |
How do I set it up?
Configure Action Mailer
In your environment config (e.g.
config/environments/production.rb), set the delivery method and SMTP settings.Rubyconfig.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { address: "smtp.unitpost.com", port: 587, user_name: "unitpost", password: ENV["UNITPOST_API_KEY"], authentication: :plain, enable_starttls_auto: true, }Set your sender
Use a
fromaddress on a verified domain in your mailer.Rubyclass UserMailer < ApplicationMailer default from: "you@yourdomain.com" def welcome_email mail(to: "customer@example.com", subject: "Welcome!") end endDeliver and verify
Trigger the mailer (
UserMailer.welcome_email.deliver_now) and confirm the send in your Unitpost Activity view.