> Source: https://docs.cyberelements.io/bastion/4.6/HowTo/SetUpEmailSending/

# Set up email sending

Several features send email: operational notifications, one-time passwords sent to users, and the delivery of TOTP secret keys. They all go through the same thing — an **SMTP server declared in the console** — and none of them works until one is available.

This page sets up that shared foundation, then points at what consumes it.

## Step 1 — Declare the SMTP server

Sign in with an administrator account, open the **Configuration** workspace and click **SMTP servers**. Click **+**.

The server you declare here is the one CyberElements Bastion will hand its messages to — an SMTP server of your infrastructure, reachable from the platform.

| Field | What to enter |
|---|---|
| **Name** | The name identifying the server in the console. |
| **Server** | The host name or the address of the SMTP server. |
| **Port** | The port it listens on. |
| **Username** / **Password** | The authentication account, if the server requires one. Leave both empty for anonymous sending. |
| **Connection type** | **TLS**, **STARTTLS** or **Insecure**. |
| **Use specific certificate authorities to validate the server certificate** | Tick this to supply the authority yourself, then upload its certificate in the field that unlocks. |

The complete description of the fields is in [SMTP servers](https://docs.cyberelements.io/bastion/4.6/Usage/AdminConsoleReference/SmtpServers/).

> **The connection is opened by the platform**
>
> The flow to the SMTP server leaves from the platform, not from the user's workstation. If your SMTP server sits on your LAN, that flow must be allowed.

## Step 2 — Test before saving

The window carries an **SMTP configuration test** block, collapsed by default. Open it, enter a destination address and click the test button. The test uses the values currently in the form — **nothing is saved by testing**.

The result appears below the button: a successful sending, or a failure with a named cause. Seven causes are recognised and spelled out, among them DNS resolution, rejected credentials, an unreachable network and a certificate that fails validation.

> **The sender of the test message is imposed**
>
> The test message is sent from `noreply@cleanroom.com`, an address **written into the product**: it cannot be configured anywhere, and it also serves as the reply-to address of that message. It is unrelated to the sender the features using this server will carry — the **SMTP sender** of a notification profile or of an OTP token.
>
> An SMTP server that restricts sending addresses will therefore reject the test whatever you enter in the form, while the real messages go through. A rejection at this point does not necessarily mean your settings are wrong.

Once the test passes, click **Validate** to save the server.

Then check that the message arrived: a server that accepts a message is not yet a message delivered.

## Step 3 — Use the server

Declaring the server sends nothing on its own. Each feature has to be pointed at it:

| To send | Where to configure it |
|---|---|
| **Operational notifications** — sign-ins, alerts, start of recording, access requests | [Notification profiles](https://docs.cyberelements.io/bastion/4.6/Usage/AdminConsoleReference/NotificationProfiles/) |
| **A one-time password by email** | [Set up multi-factor authentication](https://docs.cyberelements.io/bastion/4.6/HowTo/SetUpMultiFactorAuthentication/#setting-up-an-otp-by-email) |
| **TOTP secret keys sent to users** | [Google Authenticator integration](https://docs.cyberelements.io/bastion/4.6/Integration/MFA/GoogleAuthenticatorIntegration/) |

> **One server, several consumers**
>
> The same declared server serves all three. There is no need to declare it once per feature — and conversely, changing its settings affects every feature pointing at it.
