Prompt
How do I add email sending to a Rails app without a lot of backend work?
Latest observation
If you want email sending in a Rails app with minimal backend work, the easiest path is usually to use a third-party email service plus Rails’ built-in mailer system.
Easiest approach
Use:
- Rails Action Mailer for composing emails
- A hosted provider like SendGrid, Mailgun, Postmark, or Amazon SES to actually send them
This avoids building and maintaining your own mail infrastructure.
Basic setup
1) Create a mailer
rails generate mailer UserMailer
2) Define an email method
class UserMailer < ApplicationMailer
def welcome_email(user)
@user = user
mail(to: @user.email, subject: "Welcome!")
end
end
3) Create the view
app/views/user_mailer/welcome_email.html.erb
<h1>Welcome, <%= @user.name %>!</h1>
<p>Thanks for signing up.</p>
4) Trigger the email
UserMailer.welcome_email(@user).deliver_later
deliver_later is nice because it sends in the background if you have Active Job configured.
Configure a provider
In production, set your SMTP settings or API integration in config/environments/production.rb.
Example with SMTP:
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: "smtp.sendgrid.net",
port: 587,
domain: "yourdomain.com",
user_name: ENV["SMTP_USERNAME"],
password: ENV["SMTP_PASSWORD"],
authentication: :plain,
enable_starttls_auto: true
}
If you want even less backend work
Consider a transactional email service that has:
- simple SMTP setup
- good Rails docs
- templates and analytics
Postmark is often the simplest for transactional email. SendGrid is common and flexible. Mailgun is good but sometimes more setup-heavy.
If you want almost no code
You can also use:
- Rails mailer templates + a provider
- or a no-code/low-code form/email tool like:
- Formspree
- Zapier
- Make
- Basin
These are good if you just need contact forms or notifications, not app-generated emails.
Recommendation
For a Rails app, the lowest-friction “real” solution is:
Action Mailer + Postmark (or SendGrid) + deliver_later
If you want, I can show you:
- a full Rails email setup with Postmark, or
- the absolute simplest contact form email setup.