How do TLS/SSL and STARTTLS work?
A client connects to a server to verify the validity of an email before sending it. It specifies which SSL/TLS versions it supports, as well as the type of encryption it uses. To prove its legitimacy, the server responds with its digital certificate. Once everything has been validated, both parties create and share a special key that will later be used to decrypt the exchanged messages.