Send Rails mail through SecureSMTP
Point Action Mailer’s SMTP settings at SecureSMTP. Every mailer then sends through us.
Setup
Send from your server with SMTP or one HTTPS request. There is no SDK to install.
- 1
Create a SecureSMTP account
Sign up at securessmtp.com/signup. The Free plan includes 5,000 emails a month. No card needed.
- 2
Add a site and copy its API key
Dashboard → Sites → + Add website. The last step shows the site’s API key (it starts with qcs_live_). It is shown only once, so copy it. The API keys page (/app/forms/api-keys) also shows the SMTP settings. Store the key in an environment variable (for example SECURESMTP_API_KEY). Never commit it or send it to the browser.
- 3
What to install
No gem needed. Point smtp_settings in config/environments/production.rb at smtp.securessmtp.com.
- 4
Make your first send
Copy the snippet below into a server-side endpoint or background job. Replace to, subject and the body with your own values.
- 5
Test it
Trigger your endpoint once. With the API, check that the response has ok: true. The email shows up in the Email log in your dashboard.
# config/environments/production.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.securessmtp.com',
port: 587,
user_name: 'securessmtp',
password: ENV['SECURESMTP_API_KEY'],
authentication: 'plain',
enable_starttls_auto: true,
}
# Then call any Mailer class as normal:
ContactMailer.with(message: params[:message]).contact_email.deliver_laterWhat you get
DKIM-signed email
Every email is signed with DKIM. With a verified sending domain it is signed as your domain, so DMARC passes for your domain.
Spam check before sending
Each email goes through a content check and an AI spam check before it leaves, so junk form posts do not go out under your name.
Email log and events
Every email is in the dashboard Email log with its status. Delivered, bounced, opened and clicked events can be posted to your server by webhook.
Retries on temporary errors
If the receiving server asks us to try again later, we keep trying and send an email.delayed event.
FAQ
How long does setup take?
A few minutes: add a site, put the key in an environment variable and add the snippet.
Which From address will people see?
Without a verified sending domain, mail goes out from [email protected] with your sender name, and the original From address becomes the Reply-To. With a verified sending domain (Starter plan or higher), mail goes out from the address you set for that domain.
What happens if SecureSMTP cannot be reached?
The API call or SMTP login fails and the platform or automation tool shows the error; most automation tools can retry a failed step. Once we accept an email, we keep retrying if the receiving server asks us to try again later.
Can I send from my own domain?
Yes, on the Starter plan or higher. Add a sending domain in the dashboard and publish one DKIM TXT record (the advanced setup adds two more records). Emails sent from a verified domain do not count toward the monthly limit.