SMTP Support
TLS / STARTTLS, authentication, and per-message context cancellation
SMTP, templating, retries, rate limiting, connection pooling, async sending, middleware, DKIM signing, and provider adapters for SendGrid, Mailgun, and AWS SES — composable, well-tested, and dependency-light.
go get github.com/KARTIKrocks/goemailTLS / STARTTLS, authentication, and per-message context cancellation
Go html/text templates for HTML and plain-text email bodies
Send files with proper MIME encoding and content types
Configurable exponential backoff for transient SMTP failures
Built-in token-bucket limiter to avoid overwhelming providers
Reuse SMTP connections for high-throughput sending
Background queue with configurable workers and buffer size
Composable logging, metrics, recovery, and lifecycle hooks
SendGrid, Mailgun, and AWS SES via HTTP APIs (separate modules)
RSA-SHA256 / Ed25519 signing per RFC 6376 + 8463 — zero extra deps
Receive and normalize delivery events from any provider
Bring your own logger — slog, zap, logrus, zerolog, anything
Drop-in test double with assertions on sent messages
Automatic header-injection protection and address validation
net/smtp gets you a connection and a DATA command. Everything past that — the parts that turn “I can send one email” into “I can run this in production” — is what goemail provides. It is not a replacement for net/smtp; the default Sender is built on top of it.
| Capability | goemail | Raw net/smtp |
|---|---|---|
| Retry with exponential backoff | Included | You build it |
| Connection pooling for high throughput | Included | You build it |
| Rate limiting | Included | You build it |
| DKIM signing (RSA-SHA256 / Ed25519-SHA256) | Included | You build it |
| HTML templates, attachments, batch sending | Included | You build it |
| Provider HTTP adapters (SendGrid, Mailgun, AWS SES) | Included | You build it |
| Middleware (logging, metrics, hooks, recovery) | Included | You build it |
| Header injection protection, address validation | Included | You build it |
| Async sending with a buffered worker queue | Included | You build it |