---
title: "Grafana SMTP settings for alert email"
description: "The smtp section of grafana.ini: host and port in one value, MandatoryStartTLS, and a contact point test."
url: https://www.unitpost.com/docs/smtp/grafana
section: SMTP
updated: 2026-11-02
---
# Grafana SMTP settings for alert email

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

## Grafana SMTP settings for alert email

> The smtp section of grafana.ini: host and port in one value, MandatoryStartTLS, and a contact point test.

Grafana sends alert notifications, user invites and password resets with the `[smtp]` section of `grafana.ini` (`/etc/grafana/grafana.ini` on deb and RPM installs). `host` takes host and port in one value, and Grafana switches to implicit TLS only when that port is exactly 465. Unitpost's 2465 fallback therefore won't work here; if 587 is blocked, use 2587.

### 1. Create a send-only key

In Unitpost, open Settings → SMTP and create a send-only key. `from_address` defaults to `admin@grafana.localhost`, so change it to an address on a verified domain (/docs/domains).

### 2. Edit grafana.ini

Left empty, `startTLS_policy` upgrades only if the server offers it; `MandatoryStartTLS` refuses to send without TLS. For implicit TLS, use `host = smtp.unitpost.com:465` and leave the policy empty.

```ini
[smtp]
enabled = true
host = smtp.unitpost.com:587
user = unitpost
password = pk_live_...
from_address = grafana@yourdomain.com
from_name = Grafana
startTLS_policy = MandatoryStartTLS
```

> In Docker, each key maps to `GF_SMTP_<KEY>`: `GF_SMTP_ENABLED=true`, `GF_SMTP_HOST=smtp.unitpost.com:587`, `GF_SMTP_USER=unitpost`, `GF_SMTP_PASSWORD`, `GF_SMTP_FROM_ADDRESS` and `GF_SMTP_STARTTLS_POLICY`.

### 3. Restart Grafana

Grafana reads `grafana.ini` at startup.

```bash
sudo systemctl restart grafana-server
```

### 4. Test an email contact point

Go to Alerts & IRM → Alerting → Notification configuration and open the Contact points tab. Edit or create a contact point with the Email integration, click Test, then Send test notification.

### 5. If the test fails

`SMTP not configured, check your grafana.ini config file's [smtp] section` means `enabled` is still `false` or Grafana hasn't restarted. A timeout on 2465 is the port 465 rule above. `550 5.7.1` means `from_address` isn't on a verified domain.

## Related

- [Set up Discourse email over SMTP](https://www.unitpost.com/docs/smtp/discourse): DISCOURSE_SMTP_* in containers/app.yml, a rebuild, then Send test email from the admin Emails page.
- [Configure Mastodon to send email over SMTP](https://www.unitpost.com/docs/smtp/mastodon): SMTP_* in .env.production with SMTP_ENABLE_STARTTLS=always on 587, then restart Sidekiq.
- [Nextcloud SMTP settings for the email server](https://www.unitpost.com/docs/smtp/nextcloud): Basic settings → Email server or the mail_* keys in config.php; the From address is split in two.
