Skip to main content
This page explains how to configure email notifications in OpnForm. By default, with a new Docker deployment, the email driver used is log, which simply logs the emails instead of sending them. To enable actual email sending, you need to set up a proper email configuration. OpnForm uses Laravel’s mail system. For more detailed information, you can refer to the Laravel Mail documentation.

Email Configuration Options

Self-hosted OpnForm has two email configuration levels:
  • Instance-wide email sending: Configure the default mailer for your whole OpnForm instance with environment variables such as MAIL_MAILER, MAIL_HOST, and MAIL_FROM_ADDRESS. This is the standard setup for sending account emails, notifications, and any form email notification that does not use workspace-specific SMTP settings.
  • Workspace email settings: Configure a custom SMTP server from a workspace’s Email Settings page. These settings apply only to that workspace and override the instance-wide mailer for that workspace’s form email notifications. Workspace email settings are a self-hosted Enterprise feature.
You do not need workspace email settings to send emails from a self-hosted instance. Configure the instance-wide MAIL_* variables first, then use workspace email settings only when a workspace needs its own SMTP server or sender identity. See Workspace Custom SMTP for details.

Supported Mail Drivers

Laravel supports various mail drivers, including SMTP, Mailgun, Postmark, Amazon SES, and more. In this guide, we’ll focus on setting up SMTP, which is widely used.

Configure Instance-Wide SMTP Settings

To configure SMTP for the whole instance, set the following environment variables in your backend .env file:
VariableDescription
MAIL_MAILERSet this to smtp to use the SMTP driver.
MAIL_HOSTThe address of your SMTP server.
MAIL_PORTThe port used by your SMTP server (common ports are 25, 465, and 587).
MAIL_USERNAMEThe username for your SMTP account.
MAIL_PASSWORDThe password for your SMTP account.
MAIL_ENCRYPTIONThe encryption method used by your SMTP server (typically tls or ssl).
MAIL_FROM_ADDRESSThe email address that emails should be sent from.
MAIL_FROM_NAMEThe name that should appear as the sender of the emails.
After changing these variables, restart the API container or process so Laravel loads the new mail configuration.

Configure Workspace SMTP Settings

Workspace email settings let a workspace send its form email notifications through a dedicated SMTP server instead of the instance-wide mailer. Use workspace email settings when:
  • A customer or internal team needs emails to come from their own domain.
  • Different workspaces need different SMTP credentials.
  • You want form notifications for one workspace to use a separate sender reputation or provider.
To configure workspace SMTP settings:
1

Open workspace settings

Open the workspace where you want to use a custom sender, then go to Email Settings.
2

Enter SMTP credentials

Add the SMTP host, port, encryption, username, password, and sender address for that workspace.
3

Save the settings

Save the workspace email settings. Form email notifications from this workspace will use this SMTP server when the workspace has access to the feature.
Workspace email settings do not replace the instance-wide mail configuration. Keep the MAIL_* variables configured as the default sender and fallback for your instance. Workspace email settings require a self-hosted Enterprise license.
The easiest way to get started with OpnForm is through our official managed service in the Cloud. It takes just 1 minute to start building forms with the free plan, with high availability, backups, security, and maintenance all managed for you.