Definition
SMTP (Simple Mail Transfer Protocol) is the fundamental protocol that enables email transmission across the internet. It defines how email messages are formatted, how mail servers communicate with each other, and how messages are routed from the sender to the recipient.
SMTP is the foundation of all email delivery. Every email sent — whether through Gmail, Outlook, a marketing platform, or a custom application — relies on SMTP for transmission. Understanding SMTP basics helps marketers diagnose delivery issues, configure email platforms, and communicate effectively with technical teams.
How SMTP Works
- An email client or application submits a message to an SMTP server (outgoing mail server)
- The SMTP server looks up the recipient's domain in DNS to find the MX (Mail Exchange) record
- The sending SMTP server connects to the receiving SMTP server
- The servers exchange commands and responses using SMTP protocol
- The sending server transmits the message headers and body
- The receiving server accepts the message and delivers it to the recipient's mailbox
- If the receiving server is unavailable, the sending server queues the message and retries
SMTP Ports
| Port | Protocol | Encryption | Use |
|---|---|---|---|
| 25 | SMTP | None (plaintext) | Server-to-server relay, often blocked by ISPs |
| 587 | SMTP | STARTTLS (upgraded to encrypted) | Email client submission — recommended |
| 465 | SMTPS | SSL/TLS (encrypted from start) | Legacy submission, still widely used |
| 2525 | SMTP | STARTTLS | Alternative port when 587 is blocked |
SMTP Commands
SMTP uses a series of text-based commands between servers:
| Command | Purpose | Example |
|---|---|---|
| HELO/EHLO | Identify the sending server | EHLO mail.example.com |
| MAIL FROM | Specify the sender | MAIL FROM: sender@example.com |
| RCPT TO | Specify the recipient | RCPT TO: recipient@example.com |
| DATA | Begin message transmission | DATA |
| QUIT | End the session | QUIT |
SMTP Response Codes
SMTP servers return numeric codes that indicate the status of each command:
| Code Range | Meaning | Common Codes |
|---|---|---|
| 2xx | Success | 250 (OK), 252 (verified) |
| 3xx | Information needed | 354 (start data input) |
| 4xx | Temporary failure | 450 (mailbox unavailable), 451 (local error), 452 (insufficient storage) |
| 5xx | Permanent failure | 550 (mailbox not found), 551 (user not local), 552 (exceeded storage), 553 (name not allowed) |
SMTP vs API Sending
| Factor | SMTP | API |
|---|---|---|
| Protocol | Text-based commands | HTTP/JSON |
| Setup | SMTP credentials required | API key required |
| Features | Basic sending | Advanced features (templates, analytics, suppression) |
| Error handling | Response codes | Error objects with details |
| Personalisation | Manual header injection | Built-in template variables |
| Best for | Custom applications, legacy systems | Modern marketing platforms |
Related Glossary Terms
A/B Testing
A/B testing in email marketing is the practice of sending two variations of an email to a small sample of your list to determine which version performs better before sending the winner to the remaining subscribers.
Abandoned Cart Email
An abandoned cart email is an automated message sent to customers who added items to their online shopping cart but left without completing the purchase. It is one of the highest-converting email types in ecommerce.
AIDA Model for Email
The AIDA model (Attention, Interest, Desire, Action) is a classic copywriting framework used to structure email campaigns that guide subscribers from awareness to conversion.
AMP for Email
AMP for Email is a Google-developed framework that allows email messages to include interactive elements like forms, carousels, accordions, and live content. It turns static emails into dynamic, interactive experiences directly inside the inbox.
Announcement Email
An announcement email is a dedicated campaign that communicates a specific update, milestone, or change to subscribers, from product launches and feature releases to company news and events.
AOL Mail for Email Marketers
AOL Mail is a legacy email provider with specific deliverability requirements and rendering quirks, now operating as part of the Yahoo+AOL network under shared infrastructure.
Frequently Asked Questions
SMTP is used for sending email. IMAP is used for receiving and managing email in a mailbox. SMTP pushes messages toward the recipient. IMAP pulls messages from the server to the email client. Both are needed for most email usage.
Port 25 is commonly blocked by internet service providers to prevent spam. Spammers historically used port 25 to send large volumes of email directly. Email marketers should use port 587 or 2525 for submitting messages to their SMTP relay.
SMTP authentication (SMTP AUTH) requires the sender to provide a username and password before the SMTP server accepts messages for relay. It prevents unauthorised use of the SMTP server by spammers. Most SMTP relays also support IP whitelisting as an alternative.
An MX record tells the sending SMTP server where to deliver the message. When a server looks up the recipient's domain, the MX record provides the hostname of the receiving mail server. The sending server then connects to that hostname using SMTP to deliver the message.
SMTP errors during campaign sending indicate delivery failures. Temporary errors (4xx codes) mean the sending system will retry automatically. Permanent errors (5xx codes) mean the message cannot be delivered and the recipient should be suppressed. Monitoring SMTP responses helps maintain list quality and sender reputation.