Grafana
Check what an alert actually looks like, without waking anyone up.
1Enable SMTP
# grafana.ini [smtp] enabled = true host = smtp.mailclutch.com:587 user = mc_0000000000000000 password = pw_0000000000000000 from_address = staging@example.com from_name = Grafana
In a container, the same settings are environment variables:
GF_SMTP_ENABLED=true GF_SMTP_HOST=smtp.mailclutch.com:587 GF_SMTP_USER=mc_0000000000000000 GF_SMTP_PASSWORD=pw_0000000000000000 GF_SMTP_FROM_ADDRESS=staging@example.com
Restart Grafana for the change to take.
2Send a test message
Alerting → Contact points → the email contact point → **Test**. The message lands in the sandbox with the template it would really use.
Watch it land
Open the sandbox and the message is there — rendered HTML, plain text, raw source, attachments, and the SPF, DKIM and DMARC verdicts. It updates live, so you can leave it open next to your terminal.
Nothing is ever delivered onward, whatever address you send to; claim the inbox with an account and it stays.
Awaiting your email
Send from any address; it stops here rather than going onward. The inbox keeps what it catches for 24 hours.
What usually goes wrong
host is one field
Grafana takes
host:porttogether. A bare hostname falls back to port 25, which may be blocked on your network.The password in a container
GF_SMTP_PASSWORDshows up indocker inspect. That is fine for a sandbox pair, which expires on its own and can reach nothing but the sandbox.
Other stacks
The same four values in another dialect. Every guide below is filled in with the sandbox pair at the top of this page.
Frameworks and languages
- LaravelFive .env variables, no package
- SymfonyOne MAILER_DSN
- DjangoFive settings, nothing installed
- RailsAction Mailer smtp_settings
- Node.jsA Nodemailer transport
- Next.jsRoute Handler or Server Action
- Gonet/smtp, standard library
- SpringFive Spring Boot properties
- JavaJakarta Mail, no framework
- .NETMailKit: connect, auth, send
- PHPPHPMailer, no framework
- Pythonsmtplib, standard library
- Rustlettre over a STARTTLS relay