nself provides comprehensive email support with zero-configuration for development and simple setup for production across 16+ email providers.
In development mode, nself automatically sets up MailPit to capture all outgoing emails. No configuration required!
nself up
http://mailpit.local.nself.org
Setting up production email takes just 2 minutes with the interactive setup wizard:
nself email setup
This command will guide you through configuring your preferred email provider and automatically update your environment variables.
nself supports 16+ email providers with automatic configuration:
If you prefer manual configuration, you can set the following environment variables in your .env.local
file:
# SendGrid Configuration
SMTP_HOST=smtp.sendgrid.net
SMTP_PORT=587
SMTP_USER=apikey
SMTP_PASS=your_sendgrid_api_key
SMTP_SENDER=your-sender@yourdomain.com
# AWS SES Configuration
SMTP_HOST=email-smtp.us-west-2.amazonaws.com
SMTP_PORT=587
SMTP_USER=your_aws_access_key
SMTP_PASS=your_aws_secret_key
SMTP_SENDER=your-sender@yourdomain.com
# Generic SMTP Configuration
SMTP_HOST=your-smtp-server.com
SMTP_PORT=587
SMTP_USER=your_username
SMTP_PASS=your_password
SMTP_SENDER=your-sender@yourdomain.com
SMTP_SECURE=true # Use TLS/SSL
nself comes with built-in email templates for common authentication flows:
Templates are automatically configured and can be customized through the Hasura console or by modifying the authentication service configuration.
You can configure different email settings for different environments:
# Development (uses MailPit)
ENV=dev
# Production (uses configured provider)
ENV=prod
SMTP_HOST=your-production-smtp.com
SMTP_PORT=587
SMTP_USER=prod_user
SMTP_PASS=prod_password
SMTP_SENDER=noreply@yourcompany.com
nself automatically detects your email provider based on your SMTP configuration and applies optimized settings:
After configuring your email provider, you can test it by:
nself up
http://hasura.local.nself.org
Most email providers offer delivery tracking and analytics. You can monitor:
Check that MailPit is running at http://mailpit.local.nself.org
. If not, restart with nself restart
.
Verify your SMTP credentials are correct. Many providers require app-specific passwords instead of your regular password.
Ensure your SMTP_SENDER domain matches your email provider's authenticated domain. Consider setting up SPF, DKIM, and DMARC records.
If you're still having issues with email configuration: