SMTP (Simple Mail Transfer Protocol) is the standard protocol for sending email across IP networks. It operates at the application layer, using TCP for reliable data transfer. Unlike IMAP or POP3, which are used for retrieving messages, SMTP is designed for pushing mail from a client to a server or relaying it between mail servers.
Operational Workflow
The protocol uses a sequence of text commands to manage the transfer. A typical session involves the HELO/EHLO handshake, followed by MAIL FROM and RCPT TO to define the routing. The message body is transmitted after the DATA command. Each command triggers a numeric response code, such as 250 for success, allowing for real-time error handling.
SMTP is utilized by Mail Transfer Agents like Postfix and cloud services like SendGrid. It handles everything from individual messages to high-volume transactional alerts. Security is managed through ESMTP extensions, which provide AUTH for identity verification and STARTTLS for encrypting the communication channel.
Key fact: while RFC 821 originally specified port 25, modern standards recommend port 587 for client submission. This separation allows providers to enforce authentication on user-submitted mail while maintaining port 25 for server-to-server relay.