Skip to main content

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:

  1. Go to your Google Account.

  2. Select Security from the sidebar.

  3. Under the How you sign in to Google section, select 2-Step Verification.

  4. Scroll down and select App passwords.

  5. 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.
  6. Click the Generate button to create the app password.

  7. 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

info

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

Attention

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:

  1. Log into your Appsmith instance as a superuser.

  2. Go to the Admin Settings screen.

  3. Select Email from the left nav bar.

Email service provider
Configure Gmail as an email service provider
  1. 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.

    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 .

    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.
  2. 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.

  3. 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:

  1. Go to your Appsmith instance configuration file. For example, the docker.env file for Docker and the values.yaml file for Kubernetes.

  2. 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.

    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.

    APPSMITH_MAIL_SMTP_TLS_ENABLED
    Set it to true to enable transport layer security.

    APPSMITH_MAIL_SMTP_AUTH
    Set it to true to share the APPSMITH_MAIL_USERNAME and APPSMITH_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.
  3. 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.

See also

Invite Users