> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/documentation/use-octoxlabs/settings/third-party-services-settings/smtp-settings.md).

# SMTP Settings

Configure the mail server OctoXLabs uses for notification emails and the Send Mail workflow job, and send a test message.

**SMTP Settings** holds the one outgoing mail server of the platform. Once it is saved and a test mail has succeeded, OctoXLabs uses it to email notifications to users, to send the disk usage warning to the `admin` user, and to send mail from the **Send Mail** job of Action Center.

### Before you begin

* Required permission to open the page: `configurations.view_smtpconfiguration`.
* Required permission to save and send a test mail: `configurations.change_smtpconfiguration`.
* The permissions for this page can be held only by administrators. They cannot be added to a custom group.
* The host name or IP address of your mail relay, its port, and the sender address it accepts. If the relay needs authentication, the username and password.
* A network path from the OctoXLabs server to the mail relay on that port.

{% hint style="info" %}
On the SaaS (cloud) deployment, OctoXLabs sends email through AWS SES with a fixed sender address and does not use these fields. The settings below apply to on-premises installations.
{% endhint %}

### Configure SMTP

{% stepper %}
{% step %}

#### Open the page

Go to **Settings** > **3rd Party Services Settings** > **SMTP Settings**.
{% endstep %}

{% step %}

#### Enter the server details

Fill in **Hostname or IP** and **Port**. Select **Use TLS** if your relay requires TLS. Enter the **Sender Address** that appears in the From field of every message.
{% endstep %}

{% step %}

#### Enter credentials if the relay needs them

Fill in **Username** and **Password**. Leave both empty for a relay that accepts unauthenticated mail.
{% endstep %}

{% step %}

#### Save

Click **Save**. The console shows **Smtp configuration has been saved**.
{% endstep %}

{% step %}

#### Send a test mail

Enter a recipient in **Mail Recipient** and click **Send Test**. See Verify the result.
{% endstep %}
{% endstepper %}

### Settings

| Setting            | Type     | Default | Description                                                                                                                                      |
| ------------------ | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Hostname or IP** | Text     | Empty   | Address of the SMTP server.                                                                                                                      |
| **Port**           | Number   | `25`    | TCP port of the SMTP server.                                                                                                                     |
| **Use TLS**        | Checkbox | Off     | Starts TLS on the connection to the server. The form has no separate option for implicit SSL.                                                    |
| **Sender Address** | Text     | Empty   | Address used as the From address of every email OctoXLabs sends.                                                                                 |
| **Username**       | Text     | Empty   | Login for the relay. Optional.                                                                                                                   |
| **Password**       | Password | Empty   | Password for the relay. Optional. After saving, the console shows it as ten asterisks. Leave the asterisks in place to keep the stored password. |
| **Mail Recipient** | Text     | Empty   | Used only by **Send Test**. It is not saved. Separate several addresses with a semicolon (`;`).                                                  |

### Verify the result

Click **Send Test**. The button is disabled until **Mail Recipient** has a value. OctoXLabs saves the form first, then sends a message with the subject `Test Mail From OctoXLabs`.

* On success the console shows **Smtp test mail has been sent successfully.** and the recipient receives the message.
* On failure the console shows the error returned by the mail server or the connection.

The result of the last test is stored. Notification emails and the disk usage warning are sent only when the last test succeeded, so run **Send Test** again after every change to the server details. The connection times out after 5 seconds.

### Troubleshooting

| Symptom or error message                              | Cause                                                                                      | Fix                                                                                               |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
| **Send Test** is greyed out                           | **Mail Recipient** is empty, or you do not have `configurations.change_smtpconfiguration`. | Enter a recipient, or ask an administrator for the permission.                                    |
| The test fails with a timeout or connection error     | The server cannot reach the host and port within 5 seconds, or a firewall blocks it.       | Check the host, the port and the route from the OctoXLabs server. Test the port from that server. |
| The test fails with an authentication error           | Wrong **Username** or **Password**, or the relay does not allow that account to send.      | Re-enter both values and test again. The relay's own log usually shows the reason.                |
| The test fails after you turned **Use TLS** on or off | The relay does not match the TLS choice for that port.                                     | Match the setting to the relay: use the port and TLS mode your mail administrator gives you.      |
| The test mail arrives but notification emails do not  | The last test failed, so OctoXLabs skips email. Or the user has no email address.          | Run **Send Test** until it succeeds. Check the email address on the user.                         |
| **Send Mail** job in Action Center fails              | The platform SMTP configuration is missing or wrong.                                       | Fix and test it here. The job has no mail server settings of its own.                             |

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Action Center settings</strong></td><td>Set defaults for the Send Mail job.</td><td></td></tr><tr><td><strong>Syslog</strong></td><td>Forward activity logs to a collector.</td><td></td></tr><tr><td><strong>Users</strong></td><td>Check the email address of a user.</td><td></td></tr></tbody></table>
