E-Mail Server: Understanding SMTP
1. Introduction
SMTP (Simple Mail Transfer Protocol) is the standard protocol used for sending emails over the internet. It defines how email messages are transmitted from sender to receiver mail servers.
π In simple words:
SMTP = Protocol used to send emails
2. Role of SMTP in Email System
An email system uses multiple protocols:
| Protocol | Purpose |
|---|---|
| SMTP | Sending emails |
| POP3 | Receiving emails (download) |
| IMAP | Receiving emails (sync) |
π SMTP handles only sending, not receiving.
3. How SMTP Works (Step-by-Step)
Sender (Mail Client)
β SMTP
Outgoing Mail Server (SMTP Server)
β
Internet
β
Receiving Mail Server
β
User Mailbox (POP3/IMAP)
Steps
- User composes email
- Mail client sends it to SMTP server
- SMTP server finds recipient server
- Email is transferred
- Stored in recipient mailbox
- User reads email using POP3/IMAP
4. SMTP Communication Model
- Works on client-server architecture
- Uses TCP protocol
- Default port:
- 25 β Standard SMTP
- 587 β Secure submission
- 465 β SMTPS (SSL)
5. SMTP Commands (Important for Exams)
| Command | Purpose |
|---|---|
| HELO / EHLO | Identify client |
| MAIL FROM | Sender address |
| RCPT TO | Recipient address |
| DATA | Email content |
| QUIT | End session |
Example SMTP Session
HELO example.com
MAIL FROM:<user@example.com>
RCPT TO:<receiver@example.com>
DATA
Subject: Test Mail
Hello
.
QUIT
6. SMTP Response Codes
| Code | Meaning |
|---|---|
| 220 | Service ready |
| 250 | OK |
| 354 | Start mail input |
| 421 | Service not available |
| 550 | Mailbox not found |
7. Features of SMTP
- Reliable message delivery
- Simple text-based protocol
- Works with TCP
- Supports authentication
8. SMTP vs POP3 vs IMAP
| Feature | SMTP | POP3 | IMAP |
|---|---|---|---|
| Purpose | Send mail | Receive mail | Receive & sync |
| Direction | Outgoing | Incoming | Incoming |
| Storage | Server β Server | Download | Sync |
9. Security in SMTP
SMTP alone is not secure, so enhancements are used:
- SMTP Authentication (SMTP-AUTH)
- TLS/SSL encryption
- SPF, DKIM, DMARC for email security
10. Real-World Example
When you send mail via Gmail:
- Gmail uses SMTP server
- Sends email to recipientβs mail server
- Receiver accesses via IMAP/POP3
11. Advantages of SMTP
- Standard protocol worldwide
- Efficient email delivery
- Works with all mail systems
- Easy to implement
12. Limitations
- No built-in security (basic SMTP)
- Cannot retrieve emails
- Vulnerable to spam without security measures
13. Conclusion
SMTP is the core protocol for sending emails in any email system. It ensures reliable communication between mail servers and works together with POP3/IMAP to provide complete email functionality.
