> For the complete documentation index, see [llms.txt](https://docs.securepass.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.securepass.me/documentation/admin-user-guide/configuration/email-and-sms-gateways.md).

# Email and SMS gateways

SECUREpass sends mail and text messages constantly — one-time passwords, password reset links, dormant account warnings, approval notifications, campaign reminders. None of it leaves the platform until a gateway is configured and working.

Do this early. An OTP that cannot be delivered is an authentication method that does not work, and a reset link that never arrives is a support call. Everything that follows in the setup depends on this step.

## Opening the settings

Select **Configuration** in the left navigation, then the **Email & SMS** card.

![Configuration, with the Email & SMS card selected.](https://content.gitbook.com/content/W2srIAMN6RKFwvuEorV5/blobs/TzQ7cTqUayUnwzNPHf8R/assets/01.png)

The page opens on three tabs:

| Tab             | What it holds                                   |
| --------------- | ----------------------------------------------- |
| Configuration   | The email and SMS gateways themselves           |
| Email Domains   | The sender domains SECUREpass is allowed to use |
| Email Templates | The wording of each message SECUREpass sends    |

This page covers the first two. Templates are covered in *Email branding and templates*.

## Email gateways

The **Configuration** tab opens on **Email**, listing the gateways already configured.

![The list of configured email gateways.](https://content.gitbook.com/content/W2srIAMN6RKFwvuEorV5/blobs/QeEfRHfFQ91IDBWnXJX5/assets/02.png)

Each row shows its priority, the gateway, who created and last modified it, and whether it is active. The actions on the row edit or delete the configuration.

### Primary and secondary

Gateways are ranked by priority. The **primary** gateway carries the traffic; a **secondary** stands behind it and takes over if the primary is unavailable.

Configure a secondary. A single gateway is a single point of failure on the path every OTP travels, and the failure looks to users like SECUREpass being broken rather than a mail server being down.

### Adding an email gateway

{% stepper %}
{% step %}

## Create the email configuration

Select **Create Email Configuration**.

![The Configure EMAIL dialog.](https://content.gitbook.com/content/W2srIAMN6RKFwvuEorV5/blobs/oaqwj2zeB6fYo9biFO47/assets/03.png)
{% endstep %}

{% step %}

## Enter the gateway settings

| Field                       | What to enter                                                               |
| --------------------------- | --------------------------------------------------------------------------- |
| Email Gateway               | Required. A name for this gateway                                           |
| Priority                    | Required. Primary or secondary                                              |
| Port Number                 | Required. The SMTP port — commonly 587 for STARTTLS or 465 for implicit TLS |
| Host Name                   | Required. The mail server's hostname                                        |
| Username                    | Required. The account SECUREpass authenticates as                           |
| Password                    | Required. That account's password                                           |
| OTP Expiration (in minutes) | Required. How long a one-time password stays valid                          |
| Reciver Mail                | Required. The address test messages are sent to                             |
| OTP Length                  | How many digits the code has. Between 4 and 8; 6 by default                 |
| {% endstep %}               |                                                                             |

{% step %}

## Test and save

**Test Connection** before you continue. It confirms the host, port and credentials are right while you still have the dialog open — far quicker than discovering the problem when a user cannot receive their OTP.

Then **Continue** to save.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
OTP expiry is a security setting as much as a convenience one. Long enough that a slow mail server does not break sign-in, short enough that an intercepted code is worthless — five to ten minutes suits most deployments.
{% endhint %}

## SMS gateways

Select the **SMS** toggle on the same tab for the SMS gateways.

![The list of configured SMS gateways.](https://content.gitbook.com/content/W2srIAMN6RKFwvuEorV5/blobs/uY8kc1XjfCsUXC5vkfDG/assets/04.png)

The list works the same way, with the same priorities and the same row actions.

### Adding an SMS gateway

{% stepper %}
{% step %}

## Create the SMS configuration

Select **Create SMS Configuration**.

![The Configure SMS dialog.](https://content.gitbook.com/content/W2srIAMN6RKFwvuEorV5/blobs/s4OrOvIPC2qNCgvbG70O/assets/05.png)
{% endstep %}

{% step %}

## Enter the gateway settings

| Field                       | What to enter                                                     |
| --------------------------- | ----------------------------------------------------------------- |
| SMS Gateway                 | Required. The gateway endpoint                                    |
| Priority                    | Required. Primary or secondary                                    |
| SMS Username                | Required. The account SECUREpass authenticates as                 |
| SMS Password                | Required. That account's password                                 |
| OTP Expiration (in minutes) | Required. How long the code stays valid                           |
| Retry Attempts              | How many times delivery is retried before it is treated as failed |
| OTP Length                  | Between 4 and 8; 6 by default                                     |
| Mobile Number               | Required. The number test messages are sent to                    |
| {% endstep %}               |                                                                   |

{% step %}

## Test and save

**Test Connection** here too, then **Continue**.
{% endstep %}
{% endstepper %}

## Email domains

The **Email Domains** tab lists the domains SECUREpass is permitted to send from.

![The list of configured email domains.](https://content.gitbook.com/content/W2srIAMN6RKFwvuEorV5/blobs/9p4O7W14ooZgjSVtb0NA/assets/06.png)

Each domain shows when it was added and by whom, its status, and the actions to edit or delete it. Domains added by the platform itself show **System** as their creator.

This list is what keeps SECUREpass sending only from addresses your organisation controls. Mail from a domain that is not listed will not go out.

### Adding a domain

{% stepper %}
{% step %}

## Create the email domain

Select **Create Email Domain**.

![The Configure Email Domains dialog.](https://content.gitbook.com/content/W2srIAMN6RKFwvuEorV5/blobs/q4ptgmXdS7PjZt6NcGKz/assets/07.png)
{% endstep %}

{% step %}

## Submit the domain

Enter the domain and **Submit**. Add the domain here before you use an address on it as a sender or a recover address, not afterwards.
{% endstep %}
{% endstepper %}

## Once both are working

Send yourself a test through each gateway and confirm it arrives. A gateway that saves without error has only proved that SECUREpass accepted the settings — not that a message reaches a real inbox or handset.

After that, set the wording of the messages themselves in *Email branding and templates*.
