---
title: "Nextcloud SMTP settings for the email server"
description: "Basic settings → Email server or the mail_* keys in config.php; the From address is split in two."
url: https://www.unitpost.com/docs/smtp/nextcloud
section: SMTP
updated: 2026-11-02
---
# Nextcloud SMTP settings for the email server

## 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

## Nextcloud SMTP settings for the email server

> Basic settings → Email server or the mail_* keys in config.php; the From address is split in two.

Nextcloud sends password resets, share notifications and activity emails through the Email server form under Administration settings → Basic settings, which writes `mail_*` keys to `config/config.php`. The From address is split in two: `mail_from_address` holds only the part before the @, and `mail_domain` holds the domain.

### 1. Create a send-only key

In Unitpost, open Settings → SMTP and create a send-only key. The domain in `mail_domain` must be verified (/docs/domains).

### 2. Fill in the Email server form

Pick None/STARTTLS for port 587: Nextcloud upgrades with STARTTLS whenever the server offers it, and Unitpost always does on 587. Pick SSL (SSL/TLS in newer releases) for port 465.

- Send mode: SMTP
- Encryption: None/STARTTLS
- From address: nextcloud @ yourdomain.com
- Server address: smtp.unitpost.com : 587
- Authentication: Required
- Login: unitpost
- Password: Your Unitpost API key

### 3. Or set it in config.php

The same settings as `config/config.php` keys. `mail_smtpsecure` is `''` for STARTTLS on 587 or `'ssl'` for 465.

```php
'mail_smtpmode' => 'smtp',
'mail_smtphost' => 'smtp.unitpost.com',
'mail_smtpport' => 587,
'mail_smtpsecure' => '',
'mail_smtpauth' => true,
'mail_smtpname' => 'unitpost',
'mail_smtppassword' => 'pk_live_...',
'mail_from_address' => 'nextcloud',
'mail_domain' => 'yourdomain.com',
```

### 4. Send a test email

Add an email address to your own account under Personal info first: the test button under the form (Send email, or Send test email in newer releases) sends to it. The message then shows in Unitpost Emails.

### 5. If the test fails

`535 5.7.8` means the login isn't `unitpost`. `550 5.7.1` means `mail_domain` isn't verified. A hang on port 465 means encryption is still set to None/STARTTLS.

## Related

- [Configure Directus email over SMTP](https://www.unitpost.com/docs/smtp/directus): EMAIL_TRANSPORT=smtp and EMAIL_SMTP_* variables; EMAIL_SMTP_SECURE means port 465, not STARTTLS.
- [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.
