SMTP (Simple Mail Transfer Protocol) is the standard protocol used to send email over the Internet.
Whenever you send an email, your email client communicates with an SMTP server, which then delivers the message to the recipient's mail server.
SMTP is used only for sending email. Receiving email is typically handled by IMAP or POP3.
When you send an email, the following steps occur:
Your Email Client
│
▼
SMTP Server
│
▼
DNS MX Lookup
│
▼
Recipient SMTP Server
│
▼
Recipient Mailbox
SMTP is a text-based protocol.
Typical conversation:
HELO example.com MAIL FROM:<alice@example.com> RCPT TO:<bob@example.net> DATA (message contents) QUIT
Modern SMTP servers usually use EHLO instead of HELO because it supports additional features.
| Port | Purpose |
|---|---|
| 25 | Server-to-server email transfer |
| 587 | Message submission (recommended for clients) |
| 465 | SMTP over SSL/TLS (SMTPS) |
Today, email clients should normally use 587 with STARTTLS or 465 with implicit TLS.
Most SMTP servers require authentication before allowing users to send email.
Typical credentials:
Without authentication, the server may refuse to relay messages.
Modern SMTP uses encryption to protect credentials and message transmission.
Two common methods are:
Encryption helps protect against eavesdropping while data travels across the network.
An SMTP server that forwards email to another server is performing mail relay.
Example:
alice@example.com ↓ mail.example.com ↓ mail.example.net ↓ bob@example.net
Open relays (servers that allow anyone to relay email) are considered a major security risk and are almost always blocked.
SMTP relies heavily on DNS.
Before delivering an email, the sending server performs an MX lookup to determine which server accepts email for the recipient's domain.
Example:
example.net ↓ MX Record ↓ mail.example.net
If no valid MX record exists, delivery may fail.
SMTP servers return numeric status codes.
Common examples:
| Code | Meaning |
|---|---|
| 220 | Service ready |
| 221 | Service closing |
| 235 | Authentication successful |
| 250 | Requested action completed |
| 421 | Service unavailable |
| 450 | Mailbox unavailable (temporary) |
| 451 | Local processing error |
| 452 | Insufficient storage |
| 550 | Mailbox unavailable or rejected |
| 551 | User not local |
| 552 | Mailbox full |
| 553 | Invalid mailbox |
| 554 | Transaction failed |
Codes beginning with:
These protocols have different purposes.
| Protocol | Purpose |
|---|---|
| SMTP | Send email |
| IMAP | Read and synchronize email |
| POP3 | Download email |
SMTP sends messages, while IMAP and POP3 retrieve them.
The Telenegar Mail Check service can help diagnose SMTP-related problems such as:
These checks help improve email deliverability.
email smtp mail tls dns mx authentication