---
title: "Configure Directus email over SMTP"
description: "EMAIL_TRANSPORT=smtp and EMAIL_SMTP_* variables; EMAIL_SMTP_SECURE means port 465, not STARTTLS."
url: https://www.unitpost.com/docs/smtp/directus
section: SMTP
updated: 2026-11-02
---
# Configure Directus email over SMTP

## Connection settings

- **Host**: smtp.unitpost.com
- **Username**: unitpost (always this literal value)
- **Password**: Your Unitpost API key (must carry emails:send)
- **Port (STARTTLS)**: 587 (or 2587 if blocked, or 25)
- **Port (implicit TLS)**: 465 (or 2465 if blocked)
- **Security**: TLS 1.2 or 1.3 (required before AUTH)
- **From address**: Any address on a verified domain

## Configure Directus email over SMTP

> EMAIL_TRANSPORT=smtp and EMAIL_SMTP_* variables; EMAIL_SMTP_SECURE means port 465, not STARTTLS.

Directus sends user invites, password resets and the emails your Flows send with the `EMAIL_*` environment variables. `EMAIL_TRANSPORT` defaults to `sendmail` and `EMAIL_FROM` to `no-reply@example.com`, so both need changing. `EMAIL_SMTP_SECURE` goes to Nodemailer as `secure`, which means TLS from the first byte on port 465; on 587 leave it `false`.

### 1. Create a send-only key

In Unitpost, open Settings → SMTP and create a send-only key. Set `EMAIL_FROM` to an address on a verified domain (/docs/domains).

### 2. Set the environment variables

```env
EMAIL_TRANSPORT=smtp
EMAIL_FROM=no-reply@yourdomain.com
EMAIL_SMTP_HOST=smtp.unitpost.com
EMAIL_SMTP_PORT=587
EMAIL_SMTP_USER=unitpost
EMAIL_SMTP_PASSWORD=pk_live_...
EMAIL_SMTP_SECURE=false
```

> For port 465, set `EMAIL_SMTP_PORT=465` and `EMAIL_SMTP_SECURE=true`. Don't set `EMAIL_SMTP_IGNORE_TLS=true`: it skips STARTTLS, and Unitpost refuses to log in without TLS (`538`).

### 3. Restart Directus

Directus reads these variables when it starts, so restart the process or container. With `EMAIL_VERIFY_SETUP` at its default `true`, a failed SMTP connection is logged as `Email connection failed`.

### 4. Check the connection

Call `/server/health` with an admin token. For admins, the response includes an `email:connection` check that runs a live SMTP verify.

```bash
curl -H "Authorization: Bearer $DIRECTUS_ADMIN_TOKEN" https://directus.yourdomain.com/server/health
```

### 5. Send a real one

Use Forgot Password on the sign-in page, or invite a user from the User Directory. The email shows up in Unitpost Emails.

## Related

- [Set up SMTP for self-hosted Appwrite](https://www.unitpost.com/docs/smtp/appwrite): _APP_SMTP_* in the install's .env with _APP_SMTP_SECURE=tls for 587, then docker compose up -d.
- [Set up PocketBase mail settings over SMTP](https://www.unitpost.com/docs/smtp/pocketbase): Dashboard → Settings → Mail settings with TLS encryption Auto (StartTLS) for 587, then Send test email.
- [Configure authentik email over SMTP](https://www.unitpost.com/docs/smtp/authentik): AUTHENTIK_EMAIL__* in .env, USE_TLS for 587 or USE_SSL for 465, then ak test_email in the worker.
