Gmail
This page guides you through configuring Gmail as an email service provider on your self-hosted instance.
Prerequisites
- A self-hosted Appsmith instance. See the installation guides to set up your Appsmith instance.
- A Google Workspace account. Sign up on the Google Workspace, if you don't have one.
Create app password
If you've set up 2-Step Verification for your Google account and want to use Transport Layer Security (TLS) for configuring Gmail, then you must set up a Google app password.
If not, skip this section and move to the Configure Gmail on Appsmith section.
Follow these steps to set up a Google app password:
Go to your Google Account.
Select Security from the sidebar.
Under the How you sign in to Google section, select 2-Step Verification.
Scroll down and select App passwords.
On the App passwords screen, choose the options as shown below:
- Choose Mail for Select app.
- Choose Other for Select device, and enter a name for your Appsmith instance.
Click the Generate button to create the app password.
Copy the generated app password on the next screen, and keep it safe. You need it to configure Gmail on Appsmith in the next section.
Configure Gmail on Appsmith
Google limits sending messages. For more information, see Gmail sending limits in Google Workspace.
On Appsmith, you can configure email by using one of the following ways:
Admin settings
If you have configured email using environment variables for your instance, it takes precedence over the configuration provided through the Admin Settings UI.
Follow these steps to configure your email provider using Admin Settings:
Log into your Appsmith instance as a superuser.
Go to the Admin Settings screen.
Select Email from the left nav bar.
Configure the parameters as shown below:
- SMTP host
- To connect without using TLS protocol enter
aspmx.l.google.com
. Ensure that you add your Appsmith self-hosted instance IP address to the allowed lists in your Google workspace. For more information, see Add IP addresses to allowlists in Gmail on official Google documentation. - To connect with TLS protocol enter
smtp.gmail.com
.
- To connect without using TLS protocol enter
- SMTP port
- To connect without using TLS protocol enter
25
. Ensure that you add your Appsmith self-hosted instance IP address to the allowed lists in your Google workspace. For more information, see Add IP addresses to allowlists in Gmail on official Google documentation. - To connect with TLS protocol enter
587
.
- To connect without using TLS protocol enter
- From address
- Add a verified email address to be shown in the From field when users receive an email.
- Reply-to Address
- Add a verified email address, so users can contact you.
- Enable TLS protected connection
- This option is turned off by default. Toggle it to enable the transport layer security protocol.
- SMTP username
- Your Gmail address. This is only needed when the transport layer security protocol is turned on.
- SMTP password
- Your Gmail password. Alternatively, if you have 2-Step Verification enabled, set it to the app password you generated in the Create app password section. This is only needed when the transport layer security protocol is turned on.
Click the SEND TEST EMAIL button to verify the configuration. A toast message appears at the top of the page, indicating the success or failure of the test. Additionally, a test email is sent to your inbox on successful verification.
Click the SAVE & RESTART button to save the configurations and restart the instance with the updated settings.
Environment variables
Follow these steps to configure Gmail using environment variables:
Go to your Appsmith instance configuration file. For example, the
docker.env
file for Docker and thevalues.yaml
file for Kubernetes.Update the values of the environment variables as shown below:
- APPSMITH_MAIL_ENABLED
- Set it to
true
to enable the email service. - APPSMITH_MAIL_FROM
- Set it to the verified email of the sender.
- APPSMITH_REPLY_TO
- Set it to the email that should receive replies by default.
- APPSMITH_MAIL_HOST
- To connect without Transport Layer Security (TLS) protocol enter
aspmx.l.google.com
. Ensure that you add your Appsmith self-hosted instance IP address to the allowed lists in your Google workspace. For more information, see Add IP addresses to allowlists in Gmail on official Google documentation. - To connect using TLS protocol enter
smtp.gmail.com
.
- To connect without Transport Layer Security (TLS) protocol enter
- APPSMITH_MAIL_PORT
- To connect without using TLS protocol enter
25
. Ensure that you add your Appsmith self-hosted instance IP address to the allowed lists in your Google workspace. For more information, see Add IP addresses to allowlists in Gmail on official Google documentation. - To connect using TLS protocol enter
587
.
- To connect without using TLS protocol enter
- APPSMITH_MAIL_SMTP_TLS_ENABLED
- Set it to
true
to enable transport layer security. - APPSMITH_MAIL_SMTP_AUTH
- Set it to
true
to share theAPPSMITH_MAIL_USERNAME
andAPPSMITH_MAIL_PASSWORD
with Gmail SMTP server. - APPSMITH_MAIL_USERNAME
- Set it to your Gmail address. This is only needed when the transport layer security protocol is turned on.
- APPSMITH_MAIL_PASSWORD
- Set it to your password. Alternatively, if you have 2-Step Verification enabled, set it to the app password you generated in the Create app password Gmail section. This is only needed when the transport layer security protocol is turned on.
Save the changes and restart the Appsmith instance.
Troubleshooting
You may encounter some common errors after configuring Gmail:
If you continue to face issues, contact the support team using the chat widget at the bottom right of this page.