Receive email notifications

I turned on two-factor authentication and created an application password that I put in the stmp server password field when configuring the SMTP server, I left the “Server Security Protocol” blank but the plain value appears every time I come back to it, and I put the port number 587 but still that

I’ve written a full tutorial: How to configure the Mail Binding to use GMail for sending email from openHAB

See my edit above, you need to use STARTTLS

N.B. for gmail the two valid options are:

SMTP Server Security Protocol: STARTTLS
Server Port: 587

OR

SMTP Server Security Protocol: SSL/TLS
Server Port: 465

I thought GMail shut down port 465 awhile back. Maybe I’m misremembering.

It’s still listed here: https://support.google.com/mail/answer/7126229 and the port is still open.

I did a quick check to make sure it is not actually SSL on port 465 and it did a TLS1.3 handshake.

I’ve not checked with a real email client so it could be that the port is open but it doesn’t let you authenticate if they have deprecated that port.

1 Like

I’ll check that
thanks

ok,thanks

This may be a silly question but are you sure your openHAB host is connected to the internet?

I just looked back at your screenshot and noticed the “UnknownHostException: smtp.gmail.com”.

Yes it is connected to the internet, I work in ssh and I configure by typing the ip address of my raspberrrypi in the navigation bar of my web browser to have access to Paper UI

It is possible to be able to connect to your raspberry pi over your local network but for it to still not be able to connect to the internet.
It could just be a confusing exception but if you are still having problems try connecting to your raspberry pi over ssh and use the “ping” command to check that it can even see the SMTP server:
ping -c4 smtp.gmail.com
If you have some kind of internet connectivity problem that would obviously explain why you cannot get the mail binding to work.

When I type via ssh: ping -c4 smtp.gmail.com, nothing happens, but when I type: ping 8.8.8.8, there are 100% lost packets.
You’re right, the raspberry is not connected to the internet

Hello everyone, I managed to send the notifications by email, thank you for your interventions which allowed me to get there.
Thank you
Francky

2 Likes