nself provides comprehensive email support with zero-configuration for development and simple setup for production across 16+ email providers. The nself email command provides unified email management.
In development mode, nself automatically sets up MailPit to capture all outgoing emails. No configuration required!
nself starthttps://mail.local.nself.orgThe nself email command provides comprehensive email management.
| Command | Description |
|---|---|
nself email | Show current email configuration |
nself email setup | Interactive setup wizard |
nself email list | List all 16+ supported providers |
nself email configure <provider> | Configure a specific provider |
nself email validate | Validate current configuration |
nself email check | SMTP pre-flight connection test |
nself email test [email] | Send a test email |
nself email docs [provider] | Show provider documentation |
nself email detect | Detect current provider |
The nself email check command runs comprehensive validation before you send any emails:
$ nself email check
✓ DNS resolution: smtp.sendgrid.net → 167.89.118.51
✓ TCP connection: Port 587 open
✓ SMTP banner: 220 smtp.sendgrid.net ESMTP
✓ TLS certificate: Valid, expires 2027-03-15Setting up production email takes just 2 minutes with the interactive setup wizard:
nself email setupThis 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
AUTH_SMTP_HOST=smtp.sendgrid.net
AUTH_SMTP_PORT=587
AUTH_SMTP_USER=apikey
AUTH_SMTP_PASS=your_sendgrid_api_key
AUTH_SMTP_SECURE=true
AUTH_SMTP_SENDER=your-sender@yourdomain.com# AWS SES Configuration
AUTH_SMTP_HOST=email-smtp.us-west-2.amazonaws.com
AUTH_SMTP_PORT=587
AUTH_SMTP_USER=your_aws_access_key
AUTH_SMTP_PASS=your_aws_secret_key
AUTH_SMTP_SECURE=true
AUTH_SMTP_SENDER=your-sender@yourdomain.com# Generic SMTP Configuration
AUTH_SMTP_HOST=your-smtp-server.com
AUTH_SMTP_PORT=587
AUTH_SMTP_USER=your_username
AUTH_SMTP_PASS=your_password
AUTH_SMTP_SECURE=true
AUTH_SMTP_SENDER=your-sender@yourdomain.comnself 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
MAILPIT_ENABLED=true
# Production (uses configured provider)
ENV=prod
AUTH_SMTP_HOST=your-production-smtp.com
AUTH_SMTP_PORT=587
AUTH_SMTP_USER=prod_user
AUTH_SMTP_PASS=prod_password
AUTH_SMTP_SECURE=true
AUTH_SMTP_SENDER=noreply@yourcompany.comnself 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 startnself email test admin@example.comhttps://mail.local.nself.orgMost email providers offer delivery tracking and analytics. You can monitor:
Check that MailPit is running at https://mail.local.nself.org. If not, check status with nself status mailpit and 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: