# Send emails from OpenCTI

> Configure the mail server OpenCTI sends emails through from the interface, with basic or OAuth2 authentication, and test it without restarting the platform.

- URL: https://filigran.io/docs/lts/7.260309-lts/opencti/administer/smtp/
- Products: OpenCTI 7.260309.0-lts.8
- OpenCTI line: 7.260309 LTS · 7.260309.0-lts.8
- For: administrators, platform engineers
- Type: How-to guide

OpenCTI sends notifications, digests, password resets and disseminated files by email. This page shows how to set the mail server from the interface, so a change applies at once, without editing the configuration file or restarting the platform.

*(OpenCTI before 7.260811)*

In this version, the mail server is set only in the configuration of the platform: see the `smtp` keys in the [SMTP Service](https://filigran.io/docs/lts/7.260309-lts/reference/opencti/configuration/#smtp-service) section of the configuration reference.

## Set the mail server in the configuration file {#set-the-mail-server-in-the-configuration-file}

The `smtp` keys of the [platform configuration](https://filigran.io/docs/lts/7.260309-lts/reference/opencti/configuration/#smtp-service) set the mail server at startup, in every version, unless the SMTP configuration screen applies. Change them, then restart the platform.

`smtp:enabled` (`SMTP__ENABLED`), `true` by default, turns email sending on or off. With `false`, OpenCTI skips the mail server check at startup, logs `SMTP disabled by configuration`, and sends no email at all, without any error: password resets, notifications and disseminated files never leave the platform. Set it to `false` on a platform that must not send email, such as a test copy of production. When the SMTP configuration screen applies, its **Enable email sending** switch decides instead.

**Example: Send through a mail relay over TLS**

Example CERT sends through `smtp.example.com`, which accepts authenticated clients on port 465 with TLS from the first byte. In the docker compose file, the `opencti` service gets:

```yaml
services:
  opencti:
    environment:
      SMTP__HOSTNAME: smtp.example.com
      SMTP__PORT: 465
      SMTP__USE_SSL: 'true'
      SMTP__REJECT_UNAUTHORIZED: 'true'
      SMTP__TLS_MIN_VERSION: TLSv1.2
      SMTP__USERNAME: cti-platform@example.com
      SMTP__PASSWORD: ${SMTP_PASSWORD}
```

`SMTP__USE_SSL` opens the connection over TLS, and `SMTP__REJECT_UNAUTHORIZED` refuses a relay whose certificate does not verify. If the relay uses a private certificate authority, give its root certificate to `NODE_EXTRA_CA_CERTS` rather than turning the check off. `SMTP_PASSWORD` comes from the `.env` file next to the compose file. The `From:` address is the **Sender email address** of the [platform parameters](https://filigran.io/docs/lts/7.260309-lts/opencti/configure/parameters/).

## What's next {#what-s-next}

- [Notifiers](https://filigran.io/docs/lts/7.260309-lts/opencti/configure/notifiers/) to send notifications by email.
- [Customize the emails OpenCTI sends](https://filigran.io/docs/lts/7.260309-lts/opencti/configure/email-templates/) to shape the emails of the platform.
- The [SMTP Service keys](https://filigran.io/docs/lts/7.260309-lts/reference/opencti/configuration/#smtp-service) of the configuration reference, for timeouts and TLS versions.
