By default, Formbricks doesn’t include an SMTP server for sending emails. However, you can easily configure your self-hosted instance to use your own email provider through environment variables.
Setting up an SMTP server enables important email functionality in Formbricks, including:
- Email verification for new accounts
- Password reset emails
- Team member invitation emails
- Survey response notifications
Email Configuration Options
Formbricks uses Nodemailer to send emails and supports various SMTP providers like:
- AWS SES
- SendGrid
- Mailgun
- Gmail (for low volume)
- Custom SMTP servers
- Other SMTP providers
Required Environment Variables
To enable email functionality, configure the following environment variables:
# Basic SMTP Configuration
MAIL_FROM=noreply@yourdomain.com
MAIL_FROM_NAME=Formbricks
SMTP_HOST=smtp.yourprovider.com
SMTP_PORT=587
SMTP_USER=your_username
SMTP_PASSWORD=your_password
Additional optional settings:
# Enable SMTP_SECURE_ENABLED for TLS (port 465)
SMTP_SECURE_ENABLED=0
# If set to 0, the server won't require authentication
SMTP_AUTHENTICATED=1
# If set to 0, the server will accept connections without requiring
# authorization from the list of supplied CAs (default is 1)
SMTP_REJECT_UNAUTHORIZED_TLS=0
Enabling Email Features
By default, email verification and password reset features are disabled in Formbricks. To enable these features:
# Set to 0 to enable email verification (requires working SMTP)
EMAIL_VERIFICATION_DISABLED=0
# Set to 0 to enable password reset functionality (requires working SMTP)
PASSWORD_RESET_DISABLED=0
Configuration for One-Click Setup
If you’re using the one-click setup with Docker Compose, you can either:
- Edit the docker-compose.yml file and add the SMTP environment variables:
environment:
# Email Configuration
MAIL_FROM: noreply@yourdomain.com
MAIL_FROM_NAME: Formbricks
SMTP_HOST: smtp.yourprovider.com
SMTP_PORT: 587
SMTP_USER: your_username
SMTP_PASSWORD: your_password
EMAIL_VERIFICATION_DISABLED: 0
PASSWORD_RESET_DISABLED: 0
- Or during the setup, answer “Yes” when prompted to set up the email service:
📧 Do you want to set up the email service? You will need SMTP credentials for the same! [y/N] y
Provider-Specific Examples
SendGrid
MAIL_FROM=noreply@yourdomain.com
MAIL_FROM_NAME=Formbricks
SMTP_HOST=smtp.sendgrid.net
SMTP_PORT=587
SMTP_USER=apikey
SMTP_PASSWORD=your_sendgrid_api_key
AWS SES
MAIL_FROM=noreply@yourdomain.com
MAIL_FROM_NAME=Formbricks
SMTP_HOST=email-smtp.us-east-1.amazonaws.com
SMTP_PORT=587
SMTP_USER=your_ses_access_key
SMTP_PASSWORD=your_ses_secret_key
Gmail
MAIL_FROM=your_email@gmail.com
MAIL_FROM_NAME=Formbricks
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASSWORD=your_app_password
Note: For Gmail, you need to use an App Password if you have 2FA enabled.
Troubleshooting
If you’re experiencing issues with your email configuration:
- Check that all required environment variables are set correctly
- Verify your SMTP credentials are valid
- Ensure your email provider allows sending from the specified MAIL_FROM address
- If using Gmail, ensure you’re using an App Password
- For secure connections, make sure you’ve set the correct port and SMTP_SECURE_ENABLED value
For additional help, join the conversation on GitHub Discussions.