SMTP Configuration
SMTP Configuration
Configure custom email providers or use the default Resend service for sending emails from your Treem DAO platform.
Overview
The SMTP configuration system allows you to:
Use Default Provider: Resend service (recommended)
Add Custom SMTP: Configure your own email providers
Multiple Configurations: Set up different providers for different purposes
Active Configuration: Only one SMTP config can be active at a time
Test Configurations: Verify settings before making them active
Default Provider: Resend
Resend is the default email service provider, offering:
High delivery rates (99%+)
Built-in spam and bounce handling
Reliable infrastructure
Easy setup with API key
No additional configuration required
Resend Setup
The default Resend configuration is automatically available and requires no setup. It uses the RESEND_API_KEY
configured in your Supabase secrets.
Custom SMTP Configuration
When to Use Custom SMTP
Consider custom SMTP when you need:
Brand-specific sending domain: emails from your own domain
Higher sending volumes: enterprise-grade email providers
Compliance requirements: specific email service providers
Cost optimization: bulk sending discounts
Integration requirements: existing email infrastructure
Adding SMTP Configuration
Navigate to Admin Dashboard → Settings → Email System
Click on the Configuration tab
Click "New Configuration"
Configuration Fields
Configuration Name: Descriptive name for this SMTP setup
Example: "Gmail SMTP", "Company Mail Server"
Used for identification in the admin interface
SMTP Host: Your email provider's SMTP server
Gmail:
smtp.gmail.com
Outlook:
smtp-mail.outlook.com
SendGrid:
smtp.sendgrid.net
Custom: Your provider's SMTP hostname
SMTP Port: The port number for SMTP connections
587: STARTTLS (recommended)
465: SSL/TLS
25: Unencrypted (not recommended)
Username: SMTP authentication username
Usually your email address
For some providers, it's a specific username
Password: SMTP authentication password
Your email password
For Gmail/Outlook: App-specific password
For services like SendGrid: API key
From Email: The sender email address
Must be authorized by your SMTP provider
Example:
[email protected]
From Name: The display name for the sender
Example: "Treem DAO", "Your DAO Name"
What recipients see in their inbox
Use TLS: Enable/disable transport layer security
Recommended: Always enable for security
Required by most modern email providers
Provider-Specific Setup
Gmail Configuration
SMTP Host: smtp.gmail.com
SMTP Port: 587
Username: [email protected]
Password: [App Password - not your regular password]
Use TLS: Yes
Important: Enable 2-factor authentication and create an App Password:
Go to Google Account settings
Security → 2-Step Verification
App passwords → Generate new app password
Use the generated password in SMTP configuration
Microsoft Outlook/Office 365
SMTP Host: smtp-mail.outlook.com
SMTP Port: 587
Username: [email protected]
Password: [Your account password or app password]
Use TLS: Yes
SendGrid
SMTP Host: smtp.sendgrid.net
SMTP Port: 587
Username: apikey
Password: [Your SendGrid API Key]
Use TLS: Yes
Mailgun
SMTP Host: smtp.mailgun.org
SMTP Port: 587
Username: [Your Mailgun SMTP username]
Password: [Your Mailgun SMTP password]
Use TLS: Yes
Testing Configuration
Before activating an SMTP configuration:
Click the Test button on the configuration card
A test email will be sent to the configured "From Email" address
Check if the email is received successfully
Verify sender name and deliverability
Activating Configuration
To make a custom SMTP configuration active:
Click "Set as Active" on the desired configuration
This will deactivate all other custom configurations
The system will use this SMTP for all outgoing emails
The default Resend service will be disabled
Switching Back to Default
To return to using Resend:
Deactivate all custom SMTP configurations
The system automatically falls back to Resend
No additional configuration needed
Managing Multiple Configurations
Use Cases for Multiple Configurations
Development vs Production: Different providers for testing
Backup Configuration: Failover to secondary provider
Service-Specific: Different providers for different email types
Geographic Distribution: Regional email providers
Best Practices
Keep one active: Only one configuration should be active at a time
Test before switching: Always test new configurations
Document settings: Keep notes on provider-specific requirements
Monitor delivery: Watch analytics after switching providers
Security Considerations
Password Security
Never share SMTP passwords: Keep credentials secure
Use app passwords: When available, prefer app-specific passwords
Rotate credentials: Regularly update SMTP passwords
Audit access: Review who has access to SMTP configurations
Domain Authentication
For best deliverability with custom domains:
SPF Record: Add sender policy framework record
DKIM: Configure domain key identified mail
DMARC: Set up domain-based message authentication
MX Record: Ensure proper mail exchange configuration
Troubleshooting
Common SMTP Errors
Authentication Failed
Verify username and password
Check if 2FA requires app password
Ensure SMTP authentication is enabled
Connection Refused
Verify SMTP host and port
Check firewall settings
Confirm TLS settings match provider requirements
Sender Not Authorized
Verify "From Email" is authorized by provider
Check domain verification status
Ensure sender policy framework (SPF) is configured
Testing Delivery Issues
Check spam folders: Test emails might be filtered
Verify recipient: Ensure test email address is valid
Review provider logs: Check SMTP provider's sending logs
Test with different recipients: Try multiple email addresses
Provider-Specific Issues
Gmail Issues
Enable "Less secure app access" (not recommended) OR
Use App Passwords with 2FA (recommended)
Check Google Account security settings
Office 365 Issues
Verify SMTP authentication is enabled for the account
Check if the account requires modern authentication
Ensure the account isn't locked or suspended
Performance Monitoring
Metrics to Track
After configuring custom SMTP:
Delivery Rate: Percentage of emails successfully delivered
Bounce Rate: Emails that couldn't be delivered
Response Time: How quickly emails are sent
Error Rate: Failed sending attempts
Analytics Integration
The email analytics dashboard will show performance metrics for your active SMTP configuration, helping you monitor:
Daily sending volume
Success/failure rates
Response times
Error patterns
Migration Guide
From Default to Custom SMTP
Prepare Configuration: Set up your custom SMTP settings
Test Thoroughly: Verify all email types work correctly
Monitor Closely: Watch delivery rates after switching
Have Rollback Plan: Keep default provider as backup
Between SMTP Providers
Configure New Provider: Add new SMTP configuration
Test New Configuration: Verify functionality
Switch Active Configuration: Deactivate old, activate new
Monitor Performance: Watch for delivery issues
Update DNS Records: If changing domains, update SPF/DKIM
This comprehensive SMTP configuration system ensures reliable email delivery while providing flexibility for your specific needs.
Last updated
Was this helpful?