4.6 SMTP Email Configuration

1. Overview

ZTrust uses an SMTP (Simple Mail Transfer Protocol) server to send emails such as:

  1. Account verification emails

  2. Password reset links

  3. OTP codes

  4. Admin notifications

  5. Account Updates, etc

To enable this, you need to configure SMTP settings at the realm level in the ZTrust Admin Console.

2. Prerequisites

Before configuring, ensure you have:

  • An SMTP server (e.g., Gmail)

  • A valid email account with username & password

  • SMTP host, port, and security type (TLS/SSL) details

  • Proper firewall rules allowing outbound traffic on SMTP port ( 465)

3. Configuration via Admin Console

  1. Login to the ZTrust Admin Console.

    Fig 4.6.a: Master realm
  2. Click on Manage Realms in the sidebar to view the list of realms available in your ZTrust.

    Fig 4.6.b: List of realm under manage realms
  3. From the list of realms, select the realm where you want to configure email.

    Fig 4.6.c: Demo realm welcome page
  4. In the left sidebar, under the Configure section, Navigate to Realm Settings → Email

    Fig 4.6.d: Email tab under realm settings tab
  5. Fill in the SMTP details:

    Field
    Description

    From

    Email address that appears in the "From" field of emails.

    From Display Name

    Name that will be displayed (e.g., "ZTrust Support").

    Reply-To

    (Optional) Email address for replies.

    Host

    SMTP server hostname (e.g., smtp.gmail.com).

    Port

    SMTP port ( 465).

    Encryption

    Choose SSL

    Username

    SMTP account username (full email address for most providers).

    Password

    SMTP account password or app-specific password.

    Encryption

    select SSL (instead of None or TLS).

    Authentication

    Keep this option checked if your SMTP server requires login credentials (username & password) to send emails.

  6. Note: The password here does not refer to your email login password. You need to generate an app password from your Gmail account. Follow the steps below to generate the app password.

    1. Log in to the email account for which you need to generate the app password, click on your profile icon, and select Manage your Google Account.

      Fig 4.6.e: Gmail account info
    2. On the home page, use the search bar to type App Passwords. From the dropdown suggestions, select App Passwords.

      Fig 4.6.f: Search for App Passwords under home section
    3. You will be redirected to the App Passwords page. Enter a name for the app, for example ZTrust, and then click Create.

      Fig 4.6.g: App password tab
    4. A random app password will be generated.

      Fig 4.6.h: Successfully app password created
    5. Copy the generated password, then go to the ZTrust Admin Console. Open the realm where you want to configure SMTP and paste this password in the SMTP settings.

    6. Make sure you have configured the SMTP host, port, username, and password.

      Fig 4.6.i: Entered SMTP configuration
    7. Then save the configuration. You will see a success notification confirming that the update was successful.

      Fig 4.6.j: Saved SMTP configuration
    8. Click on Test Connection. A confirmation email will be sent to your email address to verify that the SMTP configuration was successful.

      Fig 4.6.k: Successfully connection established
    9. You have now successfully configured SMTP email in ZTrust for the selected realm. If you create a new realm, follow the same steps to configure SMTP for that realm as well.

4. Troubleshooting

  1. Emails not being sent?

    1. Check ZTrust logs (docker logs ZTrust or ZTrust server logs ).

    2. Verify SMTP credentials.

    3. Ensure firewall allows outbound SMTP ports.

  2. Authentication failed?

    1. Check username/password.

    2. For Gmail use app password.

  3. SSL handshake errors?

    1. Try switching between TLS/SSL.

    2. Ensure correct port is used.

You have successfully configured SMTP email in ZTrust Admin console for your selected realm. This enables ZTrust to send notification emails such as verification links, password resets, and account updates.

If you create additional realms, simply follow the same steps to configure SMTP for each realm.

Last updated