groundmail / symfony-mailer
Symfony Mailer transport for the Groundmail transactional email API
v0.9.2
2026-10-23 20:27 UTC
Requires
- php: >=8.1
- groundmail/groundmail: ^0.8.2
- symfony/mailer: ^6.2|^7.0
- symfony/mime: ^6.2|^7.0
Requires (Dev)
- phpunit/phpunit: ^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Groundmail for Symfony Mailer
A Symfony Mailer transport for the Groundmail transactional email API.
Send over the HTTP API with a DSN, no SMTP needed.
Docs · Get a free account · groundmail.dev
Install
composer require groundmail/symfony-mailer
export GROUNDMAIL_API_KEY=gm_your_key_here
Symfony Framework
Register GroundmailTransportFactory as a mailer.transport_factory service and set the DSN:
# config/packages/mailer.yaml framework: mailer: dsn: 'groundmail+api://%env(GROUNDMAIL_API_KEY)%@default'
Standalone
use Groundmail\Client; use Groundmail\Symfony\Transport\GroundmailTransport; use Symfony\Component\Mailer\Mailer; use Symfony\Component\Mime\Email; $mailer = new Mailer(new GroundmailTransport(new Client(getenv('GROUNDMAIL_API_KEY')))); $email = (new Email()) ->from('noreply@yourdomain.com') ->to('user@example.com') ->subject('Welcome') ->html('<p>Welcome.</p>'); $mailer->send($email);
Or build it from a DSN:
use Groundmail\Symfony\Transport\GroundmailTransportFactory; use Symfony\Component\Mailer\Transport; $transport = Transport::fromDsns( 'groundmail+api://%s@default', null, null, null, [new GroundmailTransportFactory()], ); // Or: groundmail://default?api_key=gm_…
Headers
| Header | Purpose |
|---|---|
X-Groundmail-Tag |
name=value tag (repeatable) |
X-Groundmail-Idempotency-Key |
Send once, even when your code retries |
X-Groundmail-Scheduled-At |
ISO 8601 time to send later |
Contributing
Found a bug or want something added? Open an issue. This code is published here on each release, so we port fixes rather than merging pull requests directly.
Why Groundmail
- Our own mail servers and IP space. Your password resets and receipts don't share a pool with bulk marketing senders.
- Transactional email only. No newsletters or cold outreach on the platform, which keeps the sending reputation clean.
- Start free. Free covers 3,000 emails a month. After that, pay as you go is $15 a month with 20,000 emails included, then from $0.70 per 1,000, less as you grow. Pricing
- Built for code and for agents. REST API, SMTP, SDKs for Node, Python, Go, PHP and Ruby, a CLI, and an MCP server for Claude, ChatGPT and Cursor.
All Groundmail libraries
| Use | Package |
|---|---|
| Node.js / TypeScript | groundmail on npm |
| Python (Django), Go, Ruby (Rails Action Mailer) | Groundmail/groundmail-sdks |
| PHP | Groundmail/groundmail-php |
| Laravel | Groundmail/groundmail-laravel |
| Symfony Mailer | Groundmail/groundmail-symfony-mailer |
| Nodemailer | Groundmail/groundmail-nodemailer |
| NestJS | Groundmail/nestjs-groundmail |
| Strapi | Groundmail/strapi-provider-email-groundmail |
| Medusa | Groundmail/medusa-notification-groundmail |
| AdonisJS | Groundmail/adonisjs-groundmail |
| Phoenix (Swoosh) | Groundmail/swoosh_groundmail |
| CLI | groundmail-cli on npm |
| MCP server (Claude, ChatGPT, Cursor) | Groundmail/groundmail-mcp |
| Agent skills and Claude Code plugin | Groundmail/groundmail-skills |
| Email templates (React Email, MJML, HTML) | Groundmail/email-templates |
Website · Docs · Pricing · Sign up free