The conversation
The sending server connects to the receiving server's MX host, usually on port 25. It says EHLO and its hostname; the receiver replies with what it supports. The sender says STARTTLS and the session becomes encrypted. Then MAIL FROM with the envelope sender, RCPT TO with each recipient, DATA with the headers and body, and a final dot. At every step the receiver answers with a three-digit code: 2xx accepted, 4xx try later, 5xx refused.
Submission — a mail client or sending tool handing a message to its own provider — uses the same protocol on port 587 (or 465 with implicit TLS) with a username and password. Port 25 is for server-to-server delivery and is blocked by most consumer networks.
Envelope versus header
The address in MAIL FROM is the envelope sender, also called the return-path; bounces go there and SPF is checked against its domain. The From: your recipient sees is inside the DATA, a header like any other, and nothing in SMTP ties it to the envelope. That gap is the reason DMARC alignment exists: it requires the two to agree, or requires DKIM to sign for the header domain.
Where the failures live
Rate limits are the receiver replying 4xx to RCPT TO or DATA. Authentication failures are 5xx at DATA, after the receiver has read the headers and run SPF, DKIM and DMARC. Blacklist rejections often come at connection time, before EHLO is even acknowledged. Reverse DNS is checked against the connecting IP the moment the connection opens. Reading a bounce with this sequence in mind tells you which stage refused you and, therefore, what kind of problem it is.
Check yours
These run free in your browser. Nothing you type reaches a server.
Common questions
Which SMTP port should I use?
587 with STARTTLS for submitting mail to your provider; 465 for implicit TLS where the provider offers it. Port 25 is for server-to-server delivery and is usually blocked on home and office networks.
What is the difference between a 4xx and a 5xx code?
4xx is temporary — the sender should retry later and normally does automatically. 5xx is permanent — the message was refused and retrying unchanged will fail again.
Is SMTP encrypted?
Only if both sides agree to STARTTLS, and by default the connection falls back to plaintext if anything interferes. MTA-STS lets a receiving domain forbid that fallback.
Related concepts
If this is the thing going wrong
The pages explain it. If you would rather it was simply fixed, that is the work I do.