Skip to content

Add multi-provider email support (Mailgun, SES, SMTP) - #2

Merged
corsacca merged 1 commit into
masterfrom
feature/multi-provider-email
Dec 19, 2025
Merged

Add multi-provider email support (Mailgun, SES, SMTP)#2
corsacca merged 1 commit into
masterfrom
feature/multi-provider-email

Conversation

@corsacca

Copy link
Copy Markdown
Owner

Summary

  • Add support for Mailgun HTTP API transport (bypasses SMTP port restrictions on platforms like Railway)
  • Add support for AWS SES transport
  • Keep SMTP as default/fallback for backward compatibility
  • Provider selection via EMAIL_PROVIDER environment variable ('smtp', 'mailgun', or 'ses')

Motivation

Railway and some other platforms block outbound SMTP connections on free/trial plans. Using Mailgun's HTTP API or AWS SES SDK bypasses these restrictions.

Configuration

Mailgun

EMAIL_PROVIDER=mailgun
MAILGUN_API_KEY=your-api-key
MAILGUN_DOMAIN=your-domain.mailgun.org
MAILGUN_HOST=api.eu.mailgun.net  # Optional, only for EU region

AWS SES

EMAIL_PROVIDER=ses
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key

SMTP (default)

EMAIL_PROVIDER=smtp  # or omit entirely
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=your-user
SMTP_PASS=your-password

Test plan

  • Test with Mailgun HTTP API
  • Test with AWS SES
  • Test with SMTP (existing behavior)
  • Test in development mode (MailHog)

🤖 Generated with Claude Code

- Add support for Mailgun HTTP API transport (bypasses SMTP port restrictions)
- Add support for AWS SES transport
- Keep SMTP as default/fallback for backward compatibility
- Add EMAIL_PROVIDER env var to switch between providers
- Add runtime config for Mailgun (API key, domain, host) and SES (region, credentials)

This enables email sending on platforms that block outbound SMTP (e.g., Railway)
by using HTTP-based transports instead.

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@corsacca
corsacca merged commit 3587a7e into master Dec 19, 2025
1 check failed
corsacca added a commit that referenced this pull request Dec 19, 2025
Add multi-provider email support (Mailgun, SES, SMTP)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant