SMTP not connecting

I have alternately had SMTP working and not working. Right now it is not working. I do not think it was working before the ransomware attack on my NAS which hosts the Docker installation of HA. HA has been fully restored as far as I can tell. I am assuming the code for SMTP is part of the main HA installation. Things like HACS and the .cloud folder are clearly not a part of the main code as I had to restore those separately.
In any case if there is something outside of the HA installation that would affect SMTP I am not aware of it.
My configuration file notify: entry and the log file are here:

 notify:
  - name: "email_txt"
    platform: smtp
    server: "smtp.charter.net"
    port: 587
    timeout: 15
    sender: !secret email_user

    encryption: starttls
    username: !secret email_user
    password: !secret email_pw

    recipient:
      - "[email protected]"
    sender_name: "HA"
    debug: true

Logger: homeassistant.components.notify
Source: components/smtp/notify.py:144
Integration: Notifications (documentation, issues)
First occurred: 1:28:15 PM (1 occurrences)
Last logged: 1:28:15 PM

Error setting up platform smtp
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/notify/legacy.py”, line 67, in async_setup_platform
notify_service = await hass.async_add_executor_job(
File “/usr/local/lib/python3.9/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 92, in get_service
if mail_service.connection_is_valid():
File “/usr/src/homeassistant/homeassistant/components/smtp/notify.py”, line 154, in connection_is_valid
server = self.connect()
File “/usr/src/homeassistant/homeassistant/components/smtp/notify.py”, line 144, in connect
mail.starttls(context=ssl_context)
File “/usr/local/lib/python3.9/smtplib.py”, line 790, in starttls
self.sock = context.wrap_socket(self.sock,
File “/usr/local/lib/python3.9/ssl.py”, line 500, in wrap_socket
return self.sslsocket_class._create(
File “/usr/local/lib/python3.9/ssl.py”, line 1040, in _create
self.do_handshake()
File “/usr/local/lib/python3.9/ssl.py”, line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for ‘smtp.charter.net’. (_ssl.c:1129)

When I google charter.net it leads to spectrum.net. Is it possible that the company
changed domain names and overlooked to renew its SSL certificate for charter.net? Because Home Assistant seems to be having an SSL verification problem with it:

:[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for ‘smtp.charter.net’.

As an experiment, try this:

    server: "smtp.spectrum.net"

I have spent the last hour scouring the internet for a hint at a change in mail server changes from Charter and have seen nothing. Interestingly enough, the setup on my phone is actually mobile.charter.net and using that results in a completely different error. Spectrum, because they have gobbled up so many different ISPs, has a plethora of different email server domains. The one I am using is what is suggested in most websites.
It appears there is a problem with the security certificate and that could be entirely a Charter/Spectrum issue.

I think the default encryption has now been activated which is why it may not be working for you any more.

I have been using this for almost two years (I wrote the how to):

And it stopped working a while ago. By adding encryption:none it is now working again.
encryption : none

Hi

I’m using the SMTP notify service in Nodered to send an email when an alarm was triggerered. It worked for a long time. But now Nodered shows an API errror. Probably after a recent upgrade

What shoud I do?

  1. This is my configuration file. Before i used gmail to send the email, which was working fine, but not anymore probably since an update. So today, I tried with my private account and I still have the same problem (API error)
    image

  2. And this is an entity in nodered .
    image

  3. And this is the json contents
    image

  4. But even without an image, I receive the same “API error”
    image

  5. This is the log file

? What should i do to correct this problem?

I would try and isolate whether it is NodeRed or HA first.

Can you test the service in the service page of HA: http://homeassistant.local:8123/developer-tools/service

There are also two encryption options in the smtp notifier which you could try:

The last option is to try to setup your own relay on your HA in Docker as per my link above.

Since 2022-05-30 Google no longer permits logging into Gmail using just a username and password. It requires you enable 2-factor authentication for your email account and then use what they call an “app password” (a code you generate) to use for authentication with Gmail.

Rather than do that, I made an Outlook account and use that instead (it still supports basic username/password authentication).

Thanks Taras.

I didn’t know that Gmail changed the login method.
As you have suggested, I also have created an outlook.com account just for sending alerts emails by SMTP. And it works :grinning:

Thanks