Error trying to set up smtp

Trying to set up smtp to be able to send mails to myself through HA.

config is as follows (with sensitive data changed to

  - name: summary_mail
    platform: smtp
    port: 587
    timeout: 15
    sender: [email protected]
    encryption: tls
    username: my_smtp_username
    password: !secret summary_mail_password
      - [email protected]
    sender_name: SkyHome Summary

Log is as follows:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/notify/", line 78, in async_setup_platform
    platform.get_service, hass, p_config, discovery_info
  File "/usr/local/lib/python3.7/concurrent/futures/", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/smtp/", line 84, in get_service
    if mail_service.connection_is_valid():
  File "/usr/src/homeassistant/homeassistant/components/smtp/", line 138, in connection_is_valid
    server = self.connect()
  File "/usr/src/homeassistant/homeassistant/components/smtp/", line 122, in connect
    mail = smtplib.SMTP_SSL(self._server, self._port, timeout=self._timeout)
  File "/usr/local/lib/python3.7/", line 1031, in __init__
  File "/usr/local/lib/python3.7/", line 251, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/local/lib/python3.7/", line 336, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/local/lib/python3.7/", line 1039, in _get_socket
  File "/usr/local/lib/python3.7/", line 423, in wrap_socket
  File "/usr/local/lib/python3.7/", line 870, in _create
  File "/usr/local/lib/python3.7/", line 1139, in do_handshake
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1076)

Any ideas what could be the cause of this? I have the same smtp account imported in my gmail and there it works, so credentials, server etc should be good to go.

Found it, needed to use starttls instead of tls