Send Nightingale alerts as formatted HTML emails over SMTP. Beginners can finish the setup step by step.

Overview

The Email notification channel uses the standard SMTP protocol to send alert emails — Nightingale acts as a mail client, connects to the SMTP server you provide, and pushes alerts to recipient mailboxes as HTML messages.

  • Use case: internal announcements, on-call notices, alert notifications that need to be archived.
  • Prerequisites: a working SMTP account (an enterprise mailbox is recommended; do not use your personal primary mailbox), SMTP server address and port.
  • The whole setup has three steps: ① Create an Email notification channel in Nightingale (fill in SMTP parameters) → ② Set up email addresses for Nightingale users → ③ Pick recipients in the notification rule.

Unlike DingTalk/Feishu robots, the SMTP credentials are configured on the “Notification Channel”; the notification rule only decides “which users/teams to send the alert to” — no need to repeat sender info in the rule.

Step 1: Create an Email notification channel in Nightingale

  1. Sign in to Nightingale → left menu Notification → Notification Channels.

  2. In the type panel on the left, click Email to enter the create page (URL /notification-channels/add?ident=email).

  3. Fill in the basics + SMTP configuration:

    Email notification channel form

    Section Field Notes
    Basic Name e.g. Email. This is what appears when you select the channel in a notification rule
    Basic Enabled Keep on
    Basic Note Optional
    SMTP Server SMTP server address, e.g. smtp.163.com, smtp.exmail.qq.com, smtp.office365.com
    SMTP Port Common ports: ① 25 plaintext (not recommended) ② 465 SSL ③ 587 STARTTLS
    SMTP Username Usually the full email address, e.g. alert@example.com
    SMTP Password Login password or authorization code (163 / QQ / Gmail etc. require enabling SMTP and using a dedicated authorization code, see table below)
    SMTP From The From address shown in emails. Two formats supported: alert@example.com or Nightingale Alert <alert@example.com>
    SMTP Skip Cert Verify Off by default. If the SMTP server uses a self-signed cert or has a cert error, you can turn it on temporarily; production environments should keep it off
    SMTP Batch Send Max emails reused on a single SMTP connection; 0 means a new connection per email. Default 0; no need to change unless you have very high volumes
  4. Click Save.

Common mailbox provider parameters

Provider SMTP server Recommended port Password
Aliyun Enterprise Mail smtp.qiye.aliyun.com 465 Mailbox login password
Tencent Enterprise Mail smtp.exmail.qq.com 465 Mailbox login password
NetEase 163 / 126 smtp.163.com / smtp.126.com 465 Enable “POP3/SMTP/IMAP” first, then use the authorization code
QQ Mail smtp.qq.com 465 Generate an authorization code under “Account → POP3/IMAP/SMTP”
Gmail smtp.gmail.com 587 Enable two-factor authentication and generate an App Password
Outlook / Microsoft 365 smtp.office365.com 587 Login password or app-specific password

Step 2: Set up email addresses for Nightingale users

Email recipients come from the “Email” attribute on each Nightingale user.

  1. Left menu Organization → User Management, find the users that should receive alerts.
  2. Click a username to open the detail page, fill in the Email field, save.
  3. To deliver by team, go to Team Management and add these users into a team (e.g. “Ops On-call Group”).

Step 3: Pick recipients in the notification rule

  1. Left menu Notification → Notification Rules → New (or edit an existing rule).

  2. In the “Notification Configuration” area:

    Email notification rule configuration

    • Notification Channel: pick the Email channel you just created;
    • Message Template: pick Email (built-in, contains a Subject + HTML body);
    • Recipients: multi-select; selected users receive emails based on their “Email” attribute, users without an email address are skipped;
    • Recipient Teams: multi-select; emails of all team members are added to the recipient list;
    • Applicable Severity / Time Range / Tags: filter which events to push as needed.
  3. After saving, click “Notification Test” to send a test email. Normally the selected users will immediately receive an HTML email with subject Triggered: <alert rule name> {...tags...}.

What’s in the built-in message template

The built-in Email template renders:

  • Subject: Triggered: <alert rule name> {tag=xx}; automatically becomes Recovered: ... on recovery.
  • Body: a styled HTML table containing severity, rule name, trigger value, trigger/recovery time, tags, target identifier, and other complete fields.

To change the look (company logo, colors, signature, etc.), go to Notification → Message Templates, copy the Email template and edit it with Go html/template syntax — no need to modify the notification channel.

FAQ

Q1: Why do I keep getting 535 Authentication failed / SMTP Auth failed?

A: 99% of the time it is a credentials issue:

  • 163 / QQ / Gmail and most free mailboxes do not accept the login password for SMTP authentication — generate an “authorization code / App Password” in the mailbox web UI and use that as the password;
  • Enterprise mailboxes: confirm SMTP is enabled for the account (sometimes off by default);
  • Check whether the username needs the full domain.

Q2: dial tcp: i/o timeout — cannot reach the SMTP server?

A:

  • Verify that the host running Nightingale can reach the SMTP port (telnet smtp.163.com 465);
  • Many public-cloud regions block outbound port 25 by default — switch to 465/587;
  • Corporate firewalls may only allow internal mail gateways — check with your network admin.

Q3: x509: certificate signed by unknown authority certificate error?

A: The SMTP server uses a self-signed or internal-CA certificate. You can turn on “Skip Cert Verify” in the form. Not recommended long-term in production — better to have ops install the root CA into the OS trust store.

Q4: Recipients see garbled text / no styling?

A: The default template is text/html; a few mail clients (some older mobile ones) handle HTML poorly. You can create a plain-text template under Message Templates and select it in the notification rule.

Q5: The same alert sends multiple copies to overlapping teams — what to do?

A: Just pick recipients/teams once in the notification rule — when multiple teams have overlapping members, Nightingale automatically deduplicates so each email’s To field contains each address only once.

Q6: Want alert emails to include screenshots?

A: The default template does not embed screenshots. To embed them in HTML emails, you need to:

  • Configure a dashboard on the alert rule with screenshots enabled;
  • Customize the Email template — reference the screenshot in content via <img src="{{$params.shot_url}}"/> or cid:. This is an advanced use case.

Q7: Want to send high-priority alerts / set X-Priority?

A: The SMTP notification channel currently does not support custom SMTP headers — only From/To/Subject/Body. For more flexibility, switch to a “Callback” channel and assemble the request yourself.

References

快猫星云 联系方式 快猫星云 联系方式
快猫星云 联系方式
快猫星云 联系方式
快猫星云 联系方式
快猫星云