Email Transports
Documenso supports four email transport methods:- smtp-auth - Standard SMTP with username/password (default)
- smtp-api - SMTP with API key (e.g., SendGrid, Postmark)
- resend - Resend.com API
- mailchannels - MailChannels API (Cloudflare Workers)
Required Configuration
Regardless of the transport, you must configure the sender information:Sender name displayed in emails.
Email address used as the sender.
SMTP with Authentication (Default)
Use standard SMTP with username and password. Works with most email providers.Configuration
Set to
"smtp-auth" for standard SMTP.SMTP server hostname.
SMTP server port.
587- STARTTLS (recommended)465- SSL/TLS25- Unencrypted (not recommended)
SMTP username for authentication.
SMTP password for authentication.
Set to
"true" to use SSL/TLS (port 465).Set to
"true" to disable TLS even if the server supports STARTTLS.Predefined service configuration (e.g., “gmail”, “outlook”). Automatically configures host and port.
Provider Examples
- Gmail
- Outlook/Office 365
- Amazon SES
- Mailgun
.env
SMTP with API Key
Some providers (SendGrid, Postmark) use API keys for SMTP authentication.Configuration
Set to
"smtp-api" for API key authentication.SMTP server hostname.
API key for authentication.
Username for SMTP authentication (usually “apikey”).
Provider Examples
- SendGrid
- Postmark
.env
Resend
Resend provides a modern email API with excellent developer experience.Configuration
Set to
"resend" to use Resend.Resend API key.
Complete Example
.env
Resend offers a generous free tier (100 emails/day) and is easy to set up. Recommended for getting started.
MailChannels
MailChannels is designed for Cloudflare Workers and serverless environments.Configuration
Set to
"mailchannels" to use MailChannels.Optional API key for authentication.
Custom endpoint if using a proxy worker.
DKIM Signing (Optional)
Domain for DKIM signing.
DKIM selector.
DKIM private key.
Complete Example
.env
Testing Email Configuration
After configuration, test email delivery:- Start Documenso
- Create a test account or reset password
- Check that you receive the email
- Verify the sender name and address
Testing with Mailpit (Development)
For local development, use Mailpit to catch all outgoing emails:docker-compose.yml
.env
http://localhost:8025 to view sent emails.
Email Deliverability Best Practices
Configure SPF Records
Add an SPF record to your domain’s DNS:Replace with your provider’s SPF record.
Configure DKIM
Enable DKIM signing in your email provider. Add the DKIM DNS records provided by your provider.
Use a Dedicated Domain
Send emails from a dedicated subdomain (e.g.,
mail.example.com) to protect your main domain’s reputation.Verify Domain Ownership
Complete domain verification with your email provider to improve deliverability.
Monitor Deliverability
Use tools like:
- Mail Tester
- MXToolbox
- Your email provider’s analytics
Troubleshooting
Emails not being sent
Possible causes:- Incorrect SMTP credentials
- Firewall blocking outbound connections
- Wrong port configuration
”SMTP error: 535 Authentication failed”
Cause: Invalid username or password. Solution:- Verify credentials are correct
- For Gmail, use an App Password
- Check that 2FA is configured properly
”Connection timeout”
Cause: Firewall or network issue. Solution:- Verify the SMTP host is reachable:
telnet smtp.example.com 587 - Check firewall rules
- Try a different port (587, 465, 25)
Emails going to spam
Cause: Poor domain reputation or missing authentication records. Solution:- Configure SPF, DKIM, and DMARC
- Use a dedicated IP (for high-volume senders)
- Avoid spam trigger words in email content
- Warm up your domain gradually
”550 Sender verify failed”
Cause: Sender address doesn’t match authenticated domain. Solution: EnsureNEXT_PRIVATE_SMTP_FROM_ADDRESS matches your authenticated domain.
Provider Comparison
| Provider | Setup | Cost | Deliverability | Best For |
|---|---|---|---|---|
| Resend | Easy | Free tier, then paid | Excellent | Getting started, modern API |
| SendGrid | Moderate | Free tier, then paid | Excellent | High volume |
| Amazon SES | Moderate | Pay per email | Excellent | AWS users, high volume |
| Postmark | Easy | Paid only | Excellent | Transactional emails |
| Gmail | Easy | Free (limited) | Good | Testing, very low volume |
| Mailgun | Moderate | Free tier, then paid | Excellent | Developers |
| MailChannels | Easy | Free (Cloudflare) | Good | Cloudflare Workers |
Next Steps
Database Configuration
Optimize database settings
Background Jobs
Configure job processing
