Put the SMTP connection in TLS (Transport Layer Security) mode. All SMTP commands that follow will be encrypted. You should then call ehlo() again.
If keyfile and certfile are provided, these are passed to the socket module’s ssl() function.
Optional context parameter is a ssl.SSLContext object; This is an alternative to using a keyfile and a certfile and if specified both keyfile and certfile should be None.
If there has been no previous EHLO or HELO command this session, this method tries ESMTP EHLO first.