Documentation Index
Fetch the complete documentation index at: https://mintlify.com/formbricks/formbricks/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Formbricks uses email for various features including email verification, password resets, team invitations, and survey notifications. This guide will help you configure SMTP for your self-hosted instance.SMTP Configuration
Required Environment Variables
To enable email functionality, configure the following SMTP variables in your.env file:
The email address that appears as the sender for all outgoing emails.Example:
noreply@example.comThe display name shown with the sender email address.Default:
FormbricksExample: My Company SurveysThe hostname of your SMTP server.Examples:
- Gmail:
smtp.gmail.com - SendGrid:
smtp.sendgrid.net - Mailgun:
smtp.mailgun.org - Amazon SES:
email-smtp.us-east-1.amazonaws.com - Local development:
localhost
The port number for your SMTP server.Common ports:
587- TLS/STARTTLS (recommended)465- SSL (legacy)25- Unencrypted (not recommended)1025- Local development (e.g., MailHog)
Username for SMTP authentication.This is often your full email address or an API key (for services like SendGrid).
Password or API token for SMTP authentication.Security note: Never commit this to version control. Use environment variables.
Optional SMTP Settings
Enable TLS encryption for SMTP connections.Set to
1 when using port 465. Automatically enabled if SMTP_PORT is 465.Options: 0 (disabled), 1 (enabled)Require authentication for SMTP connection.Set to
0 if your SMTP server doesn’t require credentials (not recommended for production).Options: 0 (no auth required), 1 (auth required)Verify TLS certificates when connecting to SMTP server.Set to
0 to accept self-signed certificates (useful for development).Options: 0 (accept invalid certs), 1 (reject invalid certs)Email Feature Flags
Control which email-based features are enabled:Disable email verification for new user signups.Note: Email verification requires SMTP to be configured.Options:
1(disabled) - Users can sign up without verifying their email0(enabled) - Users must verify their email before accessing Formbricks
Disable password reset functionality.Note: Password reset requires SMTP to be configured.Options:
1(disabled) - Users cannot reset passwords via email0(enabled) - Users can request password reset links
Disable email/password authentication entirely.Options:
0(enabled) - Users can sign in with email and password1(disabled) - Only OAuth/SSO authentication available
Disable the ability to invite users to organizations.Options:
0(enabled) - Users can send organization invites1(disabled) - Organization invites are disabled
Popular SMTP Providers
Gmail
For Gmail, you’ll need to create an App Password:SendGrid
Amazon SES
Mailgun
Postmark
Resend
Local Development
For local development and testing, you can use tools like MailHog or Mailpit:MailHog
http://localhost:8025
Mailpit
http://localhost:8025
Troubleshooting
Emails Not Sending
- Check SMTP credentials: Verify that your
SMTP_USERandSMTP_PASSWORDare correct - Verify port: Ensure you’re using the correct port for your provider
- Check firewall: Make sure outbound connections to SMTP ports are allowed
- Test connection: Use a tool like
telnetto test SMTP connectivity:
Authentication Errors
- Some providers (like Gmail) require app-specific passwords
- Check if your SMTP provider requires
SMTP_AUTHENTICATED=1 - Verify that your credentials haven’t expired
TLS/SSL Errors
- If using self-signed certificates in development, set
SMTP_REJECT_UNAUTHORIZED_TLS=0 - For port 465, ensure
SMTP_SECURE_ENABLED=1 - For port 587, use
SMTP_SECURE_ENABLED=0(STARTTLS will be used automatically)
Rate Limiting
Most email providers have rate limits. If you’re sending large volumes:- Check your provider’s rate limits
- Consider upgrading your email service plan
- Implement retry logic with exponential backoff
Email Templates
Formbricks uses customizable email templates for:- Welcome emails
- Email verification
- Password reset
- Team invitations
- Survey notifications
Legal Links in Emails
You can add legal links to email footers:Security Best Practices
- Use TLS: Always use port 587 with STARTTLS or port 465 with SSL in production
- Protect credentials: Never commit SMTP passwords to version control
- Use app passwords: For Gmail and similar providers, use app-specific passwords
- Verify certificates: Keep
SMTP_REJECT_UNAUTHORIZED_TLS=1in production - Monitor sending: Set up alerts for failed email deliveries
- SPF and DKIM: Configure proper email authentication for your domain
Next Steps
- Storage Configuration - Configure file uploads
- Authentication Configuration - Set up SSO and OAuth
- Environment Variables Reference - Complete list of all variables