Alert Notification with Gmail not working

Hello Peoples,
I’m new at grafana and I tried to create a alert notification channel with gmail. I changed the settings in grafana.ini according to the documentation but I always have the same errors :
‘’’
logger=alerting.notifier.email t=2022-05-31T11:23:30.4+0000 lvl=info msg=“Sending alert notification to” addresses=“unsupported value type” singleEmail=true
logger=alerting.notifier.email t=2022-05-31T11:23:30.4+0000 lvl=eror msg=“Failed to send alert notification email” error="Failed to send notification to ema$
logger=alerting.notifier t=2022-05-31T11:23:30.4+0000 lvl=eror msg=“failed to send notification” uid=jXWDHzX7z error=“Failed to send notification to email a$
$mail addresses: hugowber@gmail.com;grafanaalerttestlab@gmail.com: dial tcp 108.177.15.109:587: connect: connection refused”
‘’’

welcome to the :grafana: community @hugowber!

If you’re trying to use gmail as your SMTP server for grafana . . . you’re in luck, because I just set this up myself last month and have a config to show you

In my case, I used an app password to authenticate with gmail

This is the relevant snippet of my grafana.ini file:

#################################### SMTP / Emailing #####################
[smtp]
enabled = true
host = smtp.gmail.com:587
user = youremail@gmail.com
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
password = apppassword
cert_file =
key_file =
skip_verify = false
from_address = youremail@gmail.cm
from_name = Grafana
ehlo_identity =
startTLS_policy =
5 Likes

As Melori points out the app password does the trick. This is only configurable if 2-factor login is acitivated.

1 Like

I use this method with app password with this method and its worked.

thanks for your Help.

you’re so lucky

still doesn’t work for me.
The same username and password work for me in a local java app, but not in grafana

I use all the settings from this thread but also tried the plain config with only the minimal settings.

[smtp]
enabled = true
host = smtp.gmail.com:587
cert_file = 
key_file = 
ehlo_identity = 
startTLS_policy = 
skip_verify = false
user = app-user
password = app-password
from_address = app-address@gmail.com
from_name = Grafana

still I have only the errors:

grafana_1            | logger=ngalert.notifier.email notifierUID=a0ed440c-71bf-46c2-a926-41589b845332 t=2023-09-20T09:32:30.952337258Z level=error msg="Missing receiver"
grafana_1            | logger=ngalert.notifier.email notifierUID=a0ed440c-71bf-46c2-a926-41589b845332 t=2023-09-20T09:32:30.952401578Z level=error msg="Missing group labels"

and no more about mail