Skip to content
All Articles
Email Infrastructure

What is SMTP? How Email Actually Gets Sent (Plain English Guide)

SMTP is the protocol that moves email between servers. Understanding how it works helps you troubleshoot deliverability issues, configure mail servers, and understand SPF and DMARC.

6 min read

What is SMTP?

SMTP (Simple Mail Transfer Protocol) is the standard protocol used to send email between mail servers. Defined in RFC 5321, it's the 'push' protocol of email — it moves messages from sender to recipient by relaying them through a chain of mail servers.

When you click Send in Gmail or Outlook, your email client connects to a mail submission server, which uses SMTP to relay the message to the recipient's mail server, which then stores it for retrieval via IMAP or POP3.

SMTP has been in use since 1982. Its original design had no authentication or encryption — both were added later as extensions.

Core SMTP commands

CommandDirectionPurposeExample
EHLOClient → ServerIntroduce client and request list of server extensionsEHLO mail.example.com
MAIL FROMClient → ServerSpecify the envelope sender address (return-path)MAIL FROM:<sender@example.com>
RCPT TOClient → ServerSpecify one recipient address; repeat for multipleRCPT TO:<recipient@example.net>
DATAClient → ServerBegin email data transmission (headers + body)DATA (server replies 354, then send content, then .)
QUITClient → ServerEnd SMTP session gracefullyQUIT
RSETClient → ServerReset transaction without closing connectionRSET
STARTTLSClient → ServerUpgrade connection to TLS encryptionSTARTTLS
AUTHClient → ServerAuthenticate with server credentials (port 587)AUTH LOGIN or AUTH PLAIN

SMTP response codes reference

CodeCategoryMeaningBounce Type
2202xx SuccessServer ready — connection establishedN/A
2502xx SuccessRequested action completed successfullyN/A
3543xx IntermediateStart message input, end with CRLF.CRLFN/A
4214xx Temp FailureService temporarily unavailable; try again laterSoft bounce
4504xx Temp FailureMailbox temporarily unavailable (greylisting)Soft bounce
4514xx Temp FailureLocal error in processing; retrySoft bounce
4524xx Temp FailureInsufficient system storage / mailbox fullSoft bounce
5505xx Perm FailureMailbox unavailable or policy rejection (blacklist)Hard bounce
5515xx Perm FailureUser not local; please try forwarding addressHard bounce
5535xx Perm FailureMailbox name not allowed / syntax error in addressHard bounce
5545xx Perm FailureTransaction failed / message rejectedHard bounce

How SMTP works step by step

1. You click Send — your email client submits the message to your outgoing mail server (MSA) on port 587 with STARTTLS and SMTP AUTH.

2. Your mail server performs a DNS MX lookup to find the recipient domain's mail servers.

3. Your server connects to the recipient's MX server on port 25 and negotiates a TLS connection via STARTTLS.

4. Your server introduces itself with EHLO and lists supported extensions.

5. Your server issues MAIL FROM: (the envelope sender) and RCPT TO: (the recipient).

6. The receiving server may check blacklists, SPF records, and other reputation signals at this point.

7. Your server sends the email DATA — headers and body.

8. The receiving server accepts or rejects with an SMTP status code (2xx = accepted, 4xx = temporary failure, 5xx = permanent failure).

SMTP status codes

200-level (success): 250 OK — message accepted 400-level (temporary failure): 421 — Service unavailable, 450 — Mailbox unavailable, 452 — Insufficient storage. These generate soft bounces — retry later. 500-level (permanent failure): 550 — User unknown or policy rejection, 552 — Exceeded storage allocation, 554 — Transaction failed. These generate hard bounces.

Common deliverability errors: 550 5.7.1 — Message rejected due to spam or policy 550 5.1.1 — Invalid mailbox 421 4.7.0 — IP address sending too quickly (rate limit) 550 5.7.26 — SPF/DMARC policy violation (Gmail)

SMTP ports

Port 25: Server-to-server SMTP (MTA-to-MTA). Cannot be used for client submission — most ISPs block outbound port 25 from residential connections to prevent spam.

Port 587: Mail submission with STARTTLS and SMTP AUTH. The correct port for email clients and applications to submit outgoing email.

Port 465: Legacy SMTPS (SMTP over implicit TLS). Deprecated but still used by some clients.

Port 2525: Unofficial alternative to 587, often used by ESPs as a fallback.

Check your domain's email health

Run a free scan against 60 blacklists. Validate SPF, DKIM, DMARC, and MX records in seconds.