Send PocketBase email through the Groundmail transactional email API instead of SMTP.
Verification emails, password resets, OTPs and your own sends all go through Groundmail.
Docs · Get a free account · groundmail.dev
For PocketBase used as a Go framework (v0.23 and later).
go get github.com/Groundmail/groundmail-pocketbaseGROUNDMAIL_API_KEY=gm_your_key_herepackage main
import (
"log"
groundmailpb "github.com/Groundmail/groundmail-pocketbase"
"github.com/pocketbase/pocketbase"
)
func main() {
app := pocketbase.New()
// Reads GROUNDMAIL_API_KEY; or pass groundmailpb.Options{APIKey: "gm_…"}.
if err := groundmailpb.Register(app, groundmailpb.Options{}); err != nil {
log.Fatal(err)
}
if err := app.Start(); err != nil {
log.Fatal(err)
}
}Register hooks OnMailerSend, so every email the app sends goes through Groundmail and PocketBase's SMTP settings are not used. Set the sender under Settings → Mail settings in the dashboard, on a domain you have verified in Groundmail.
groundmailpb.Mailer implements PocketBase's mailer.Mailer interface:
m, err := groundmailpb.New(groundmailpb.Options{})
if err != nil {
return err
}
return m.Send(&mailer.Message{
From: mail.Address{Name: "Acme", Address: "noreply@yourdomain.com"},
To: []mail.Address{{Address: "user@example.com"}},
Subject: "Your receipt",
HTML: "<p>Thanks for your purchase.</p>",
})Attachments and inline attachments are sent with the message; inline files are referenced by name (cid:logo.png).
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.
- 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. 3,000 emails a month on the Free plan; Pro is 50,000 emails for $20/month. Dedicated IPs on Scale.
- 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.
| Use | Package |
|---|---|
| Node.js / TypeScript | groundmail on npm |
| Python, Go, Ruby | 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 |
| Rails (Action Mailer) | Groundmail/groundmail-rails |
| Phoenix (Swoosh) | Groundmail/swoosh_groundmail |
| PocketBase | Groundmail/groundmail-pocketbase |
| CLI | groundmail-cli on npm |
| MCP server (Claude, ChatGPT, Cursor) | Groundmail/groundmail-mcp |
| Agent skills and Claude Code plugin | Groundmail/groundmail-skills |
Website · Docs · Pricing · Sign up free