Help ›

Grafana alert emails through Office 365 or Gmail SMTP

Self-hosted Grafana sends alert notifications, invitations, password resets, and reports through a single SMTP server. Grafana signs in to this server with a username and password, and has no OAuth option for email, so it can’t send through Microsoft 365 or Gmail directly.

With Auth-Email, you change a few SMTP settings in grafana.ini (or the matching environment variables). Your contact points and alert rules stay the same.

Before you start: link the mailbox in your Auth-Email dashboard, and choose a password for it. That is the password you’ll enter in Grafana – not your mailbox password.

For a shared address, see account delegation and shared mailboxes.


Step 1: Configure Grafana’s SMTP settings

Grafana’s email settings are in the [smtp] section of its configuration file (usually /etc/grafana/grafana.ini, or conf/custom.ini). Show the settings for an account provided by Outlook:

[smtp]
enabled = true
host = outlook.auth-email.com:465
user = alerts@yourdomain.com
password = your-auth-email-password
from_address = alerts@yourdomain.com
from_name = Grafana
  • host: outlook.auth-email.com, followed by :465. Grafana connects securely using SSL/TLS automatically on this port
  • user: The linked mailbox’s full email address
  • password: The password you chose in Auth-Email. If it contains # or ;, wrap it in triple quotes ("""like this"""), or choose a new password without them by re-authorizing the account in your dashboard
  • from_address: The linked mailbox’s email address, or an address that the mailbox is allowed to send as

Restart Grafana after saving the file.

Using environment variables (Docker and Kubernetes)

If you run Grafana in a container, you can set the same values as environment variables instead:

GF_SMTP_ENABLED=true
GF_SMTP_HOST=outlook.auth-email.com:465
GF_SMTP_USER=alerts@yourdomain.com
GF_SMTP_PASSWORD=your-auth-email-password
GF_SMTP_FROM_ADDRESS=alerts@yourdomain.com

Step 2: Send a test

In Grafana, go to Alerting > Contact points, open (or create) an email contact point with your own address, and click Test. You should receive a test notification within a few seconds.


Troubleshooting

  • “535 Authentication failed”: check that user is the full email address, and that password is the one you chose in Auth-Email (not your mailbox password)
  • Connection times out or a TLS error: check that host ends with :465, and that your Grafana server (or container) can make outgoing connections on that port. If you set startTLS_policy, remove it
  • “Sender address rejected” or “SendAsDenied”: from_address must be the linked mailbox, or an address that the mailbox is allowed to send as

For other errors, such as Microsoft 365 reporting that SMTP AUTH is disabled, see fixing common errors. Your account’s connection page in the Auth-Email dashboard also shows whether Grafana has connected, and explains any error it received. Still stuck? Email us – we’ll help you get it working.


Try Auth-Email with Grafana

Link your mailbox, update Grafana’s SMTP settings, and send a test notification from a contact point.

Start your free trial →

No credit card needed. Check that it works, including sending yourself test messages, before you pay.