What is SMTP?
Simple Mail Transfer Protocol, the standard by which mail servers send email to each other.
How it works in practice
A conversation has a greeting (HELO/EHLO), the envelope (MAIL FROM, RCPT TO), the message and numeric replies. The replies - 2xx success, 4xx temporary, 5xx permanent - are what bounce messages quote and what tell you why a message wasn't accepted.
A conversation, step by step
SMTP is a text dialogue between a sending server (the client) and a receiving server. The client greets with EHLO and its hostname, names the envelope sender with MAIL FROM and each recipient with RCPT TO, sends the message after DATA, and ends with QUIT. After every command the receiver answers with a numeric reply. The envelope (MAIL FROM, RCPT TO) is what delivery uses and is separate from the From and To headers inside the message, which is why SPF is checked against the envelope sender, not the visible From.
Reading the reply codes
The first digit tells you what happened: 2xx means accepted, 4xx means a temporary failure and the sender should retry, 5xx means a permanent failure and retrying will not help. Most servers add an enhanced status code such as 5.7.1 (RFC 3463) and a human-readable text, and the text is where the reason is: the policy that blocked you, the listing that was hit, the missing authentication. Always read it together with the code.
Ports and encryption
Server-to-server delivery uses port 25. Mail clients and applications submit mail to their own provider on port 587 with STARTTLS or on port 465 with implicit TLS, usually with a login. Many cloud and residential networks block outbound port 25 by default to limit spam, which is why a new server often cannot deliver mail until the provider lifts the block.
A minimal SMTP session (S = receiving server, C = sending server)
S: 220 mx.example.org ESMTP ready C: EHLO mail.sender.com S: 250-mx.example.org S: 250 STARTTLS C: MAIL FROM:<bounce@sender.com> S: 250 2.1.0 OK C: RCPT TO:<anna@example.org> S: 250 2.1.5 OK C: DATA S: 354 Go ahead C: (headers and body) . S: 250 2.0.0 Queued C: QUIT S: 221 2.0.0 Bye
The common mistake
Reading only the three-digit code and ignoring the explanation text that follows it.
Frequently asked questions
What is the difference between SMTP and IMAP?
SMTP moves mail from a sender to a receiving server. IMAP (and POP3) are how a mail client reads the messages that are already stored in a mailbox. Sending uses SMTP, reading uses IMAP or POP3.
What does a 250 reply mean?
The command was accepted. After DATA, a 250 means the receiving server has taken responsibility for delivering the message. It says nothing about whether the recipient will see it in the inbox or in spam.
Why do I get a 5xx error when the same address worked yesterday?
A 5xx is permanent for that attempt, but the cause can change: a new listing on a blocklist, a reputation drop, or an authentication record that broke. The text after the code usually names it; the SMTP Error & Bounce Code Decoder explains the common ones.
Check it yourself
Related terms
Not sure whether this is what's hurting your inbox placement? A free deliverability review finds the real cause.
How we help: Consulting · Private infrastructure · Managed mailboxes · Monthly support