I tried another smtp service that do not require OAuth2 but I get the same result. I have also checked agains the documentation at https://www.home-assistant.io/integrations/smtp and confirmed it looks correct in my configuration.yaml file. I also checked that the mail server is reachable from within my HA with ping.
Yes of course there are entries in the log, I just did not checked the log files only in the logbook:
2025-03-08 12:12:18.724 ERROR (MainThread) [homeassistant.components.notify] Error setting up platform smtp
Traceback (most recent call last):
File "/usr/local/lib/python3.13/smtplib.py", line 398, in getreply
line = self.file.readline(_MAXLINE + 1)
File "/usr/local/lib/python3.13/socket.py", line 719, in readinto
return self._sock.recv_into(b)
~~~~~~~~~~~~~~~~~~~~^^^
TimeoutError: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 108, in async_setup_platform
notify_service = await hass.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
platform.get_service, hass, p_config, discovery_info
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 103, in get_service
if mail_service.connection_is_valid():
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 165, in connection_is_valid
server = self.connect()
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 151, in connect
mail = smtplib.SMTP(self._server, self._port, timeout=self._timeout)
File "/usr/local/lib/python3.13/smtplib.py", line 255, in __init__
(code, msg) = self.connect(host, port)
~~~~~~~~~~~~^^^^^^^^^^^^
File "/usr/local/lib/python3.13/smtplib.py", line 343, in connect
(code, msg) = self.getreply()
~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/smtplib.py", line 401, in getreply
raise SMTPServerDisconnected("Connection unexpectedly closed: "
+ str(e))
smtplib.SMTPServerDisconnected: Connection unexpectedly closed: timed out
I really don’t understand why. I will check with my provider.
I am really confused. It work perfectly well to send a mail from Thunderbird with these settings. I also checked the raw message from Thunderbird and everything is as expected. So why do I get a time-out?
Here is the log after I renamed the nofity name to “smtp _mail” and reloaded the yaml configuration. I see that a test connection is done and that fails:
2025-03-08 13:17:50.824 ERROR (MainThread) [homeassistant.components.notify] Error setting up platform smtp
Traceback (most recent call last):
File "/usr/local/lib/python3.13/smtplib.py", line 398, in getreply
line = self.file.readline(_MAXLINE + 1)
File "/usr/local/lib/python3.13/socket.py", line 719, in readinto
return self._sock.recv_into(b)
~~~~~~~~~~~~~~~~~~~~^^^
TimeoutError: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/notify/legacy.py", line 108, in async_setup_platform
notify_service = await hass.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
platform.get_service, hass, p_config, discovery_info
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 103, in get_service
if mail_service.connection_is_valid():
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 165, in connection_is_valid
server = self.connect()
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 151, in connect
mail = smtplib.SMTP(self._server, self._port, timeout=self._timeout)
File "/usr/local/lib/python3.13/smtplib.py", line 255, in __init__
(code, msg) = self.connect(host, port)
~~~~~~~~~~~~^^^^^^^^^^^^
File "/usr/local/lib/python3.13/smtplib.py", line 343, in connect
(code, msg) = self.getreply()
~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/smtplib.py", line 401, in getreply
raise SMTPServerDisconnected("Connection unexpectedly closed: "
+ str(e))
smtplib.SMTPServerDisconnected: Connection unexpectedly closed: timed out
I’m late to the discussion but the answer to your question is that if it doesn’t exist in Developer Tools → Actions then it means the supporting integration (SMTP) either isn’t installed or isn’t working properly.
In your case, it wasn’t working properly (failed connection).
So the original error message, reporting that notify.outlook didn’t exist, was the first clue that there was something wrong with the SMTP integration’s ability to use your Outlook account. The action’s absence in Developer Tools → Actions confirmed it.
Unfortunately not, only with other mail service provider. Strange is that if I misconfigure the server name then I can find the outlook action in Developer tools/Actions but with correct server address it is no longer there.
For my case it works fine now but how to do config with OAut2?