So I followed a guide and installed ssmtp and then successfully sent an email to myself via:
echo “E-Mail using the command-line” | ssmtp email@example.com
Now I am trying to setup Grafana to send email alerts, but I fail.
I use my own paid hosting smtp server btw.
In Notification channels in the web gui I have added firstname.lastname@example.org in Addresses.
[smtp] enabled = true host = mail.server:465 user = email@example.com # If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" password = password ;cert_file = ;key_file = skip_verify = true from_address = firstname.lastname@example.org from_name = Grafana # EHLO identity in SMTP dialog (defaults to instance_name) ;ehlo_identity = dashboard.example.com # SMTP startTLS policy (defaults to 'OpportunisticStartTLS') ;startTLS_policy = NoStartTLS Error log: t=2020-12-14T23:29:09+0000 lvl=eror msg="failed to send notification" logger=alerting.notifier uid= error="Failed to send notification to email addresses: email@example.com: dial tcp: lookup mail.server: no such host" remote_addr=127.0.0.1
Error log doesn’t list 465 port after the host name, which I find odd (Grafana server restarted many times)
Usernames and host names altered for privacy.