What Is SMTP?
TL;DR
SMTP, or Simple Mail Transfer Protocol, is the protocol that carries email from one server to another. A transaction is a short exchange of text commands: the sender identifies itself, declares the return address with MAIL, names each recipient with RCPT, then transfers the message after DATA.
What happens during an SMTP transaction?
The client opens a connection and greets the server with EHLO, which answers with the list of extensions it supports. The client then issues MAIL to declare the return address, one RCPT for each recipient, and DATA to begin the message itself.
Everything before DATA is the envelope and everything after it is content. That split is why SPF authenticates the MAIL address rather than the From header, and why a receiver can refuse a recipient before a single byte of the message has been sent.
Which SMTP ports are used for what?
Port 25 is server to server. MX records carry no port, so relay between mail servers always uses 25, which is also why many networks and cloud providers block outbound 25 for anything other than a known mail host.
Submission, meaning a client or an application handing a message to its own provider, uses 587 with STARTTLS or 465 with implicit TLS. Implicit TLS means the handshake begins the moment the connection opens, and current guidance is for a submission service to offer both.
Where does encryption fit into SMTP?
SMTP itself is plain text, and TLS is added by the STARTTLS extension after the greeting. It is opportunistic by default, so when a receiving server does not offer STARTTLS most senders deliver the message unencrypted rather than fail.
That default is what MTA-STS exists to close. A published policy tells senders that TLS and a valid certificate are required for your mail hosts, so an attacker cannot force a downgrade by stripping the STARTTLS offer.
Frequently asked questions
No, only to send and relay it. Reading a mailbox uses IMAP or POP3, or a provider API. That is why an application which only needs to send mail is configured with SMTP submission credentials and nothing more.