Skip to main content
Spree sends transactional emails such as order confirmation, password reset, shipping notifications, etc. You can use any SMTP provider — Resend, Postmark, Mailgun, SendGrid, Amazon SES, or your own SMTP server.

Configuration

Set the following environment variables to enable email delivery:
VariableDefaultDescription
SMTP_HOSTSMTP server address (e.g., smtp.sendgrid.net, smtp.resend.com)
SMTP_PORT587SMTP server port
SMTP_USERNAMESMTP auth username
SMTP_PASSWORDSMTP auth password
SMTP_FROM_ADDRESSDefault “from” email address (e.g., orders@mystore.com)
RAILS_HOSTexample.comHost used in email URLs
When SMTP_HOST is not set, emails are printed to the Rails log instead of being sent.

Provider Examples

SMTP_HOST=smtp.sendgrid.net
SMTP_USERNAME=apikey
SMTP_PASSWORD=SG.your-sendgrid-api-key
SMTP_FROM_ADDRESS=orders@mystore.com
Remember to verify the email address in SendGrid you intend to use for sending, otherwise emails will be rejected. Read more about sender verification.

Local Development

In local development, emails are printed to the Rails log by default. To preview emails with a web UI, run Mailpit:
docker run -d --name mailpit -p 8025:8025 -p 1025:1025 axllent/mailpit
SMTP_HOST=localhost bin/dev
Open http://localhost:8025 to see all outgoing emails.
If you’re using docker compose up for development, Mailpit is included automatically and all emails are caught at http://localhost:8025.