Skip to content
Home Β» Understanding SMTP

Understanding SMTP

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:

ProtocolPurpose
SMTPSending emails
POP3Receiving emails (download)
IMAPReceiving 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

  1. User composes email
  2. Mail client sends it to SMTP server
  3. SMTP server finds recipient server
  4. Email is transferred
  5. Stored in recipient mailbox
  6. 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)

CommandPurpose
HELO / EHLOIdentify client
MAIL FROMSender address
RCPT TORecipient address
DATAEmail content
QUITEnd 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

CodeMeaning
220Service ready
250OK
354Start mail input
421Service not available
550Mailbox not found

7. Features of SMTP

  • Reliable message delivery
  • Simple text-based protocol
  • Works with TCP
  • Supports authentication

8. SMTP vs POP3 vs IMAP

FeatureSMTPPOP3IMAP
PurposeSend mailReceive mailReceive & sync
DirectionOutgoingIncomingIncoming
StorageServer β†’ ServerDownloadSync

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.