Configure Directus email over SMTP

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`.

Need an API key?

SMTP password is a Unitpost API key with emails:send. Username is always unitpost.

  • 5,000 emails/month
  • 3 API keys
  • 5 sending domains
Get free SMTP key
  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.

  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.

    Shell
    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.

Search docs and guides

Search the docs and product guides.