I’m having trouble getting SMTP working. I’ve been working on this for weeks but can’t seem to get it up and running. I have edited the config.yaml file to include the parameters for my email domain.
notify:
- name: smtpmail
platform: smtp
server: mail40.newtekwebhosting.com
port: 465
timeout: 15
sender: !secret notification_sender
starttls: true
encryption: starttls
username: !secret notification_username
password: !secret notification_password
recipient: !secret notification_recipient
sender_name: Home Assistant
verify_ssl: true
Using the startup log I found that SMTP errors-out on load and suspends running. The system log produces the following error log. Does anyone have some guidance on how to interpret this report?
Logger: homeassistant.components.notify
Source: components/notify/legacy.py:108
integration: Notifications (documentation, issues)
First occurred: 5:56:52 PM (1 occurrences)
Last logged: 5:56:52 PM
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 58, 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