In an era where email communication is a routine part of daily life for people worldwide, whether sending personal messages or conducting business, email has become an essential tool that enhances communication efficiency, speed, and cost-effectiveness. But have you ever wondered how that information travels when you hit the “Send” button? The answer lies in something called SMTP.
SMTP stands for Simple Mail Transfer Protocol, which is a standard protocol used for sending emails over the internet. This article will take you through an in-depth understanding of SMTP, covering basic concepts, how it works, the structure of commands, real-world scenarios, as well as security and configuration in email systems.
What is SMTP?
SMTP (Simple Mail Transfer Protocol) is a network protocol used for sending email messages from the sender to the recipient, particularly when emails are sent from an email client (such as Outlook, Thunderbird, or Gmail via the web) to an email server, and from one server to another.
Although SMTP is responsible for “sending” emails, it is not the entity that “receives” emails from the destination server. The task of receiving emails is typically handled by other protocols, such as POP3 (Post Office Protocol) or IMAP (Internet Message Access Protocol).
History of SMTP
SMTP was first developed in 1982 by Jon Postel and published in RFC 821 by the Internet Engineering Task Force (IETF), which is considered an open standard. SMTP replaced earlier protocols such as the Mail Box Protocol and has become the primary standard in use today.
The current version of SMTP is referenced in RFC 5321, which was updated and improved from RFC 821 to support the rapidly evolving needs of the Internet.
How SMTP Works
SMTP operates on a client-server model, meaning that an email client (such as a user’s email program) connects to an SMTP server and sends commands through a designated port, typically port 25 (unencrypted), 587 (STARTTLS), or 465 (SSL).
The sequence of operations is as follows:
- The user clicks to send the email.
- The email client establishes a connection with the SMTP server.
- The server has accepted the connection.
- The client sends the EHLO or HELO command to initiate the conversation.
- The server sends a response back.
- The client specifies the sender with the MAIL FROM command.
- Followed by the RCPT TO command to specify the recipient.
- The DATA command is used to initiate the transmission of email content.
- After the content ends, signal the end with a period (.).
- The server has successfully received the data.
- The client sends a QUIT command to terminate the connection.
Basic SMTP Commands
SMTP uses a set of plain text commands, with the main commands you should know including:
- HELO / EHLO – Used to initiate a connection with the server.
- MAIL FROM: – Specify the sender’s email address
- RCPT TO: – Specify the recipient
- DATA – Used to start sending email content
- RSET – Reset Transmission Status
- VRFY – Verify that the user actually exists.
- NOOP – A command that does nothing. Used to test connectivity.
- QUIT – Disconnect from the server.
Ports Used in SMTP
SMTP connections can use multiple ports for different purposes:
- Port 25 – The original port used for sending emails from one server to another.
- Port 587 – Used for clients that want to send emails securely using STARTTLS
- Port 465 – Used with direct SSL encryption (not supported by all servers)
About SMTP Authentication
To prevent unauthorized email transmission (such as spam), SMTP has developed SMTP AUTH, an authentication mechanism whereby the sender must provide a username and password to verify their authorization to send emails through the server.
SMTP AUTH works with security protocols such as STARTTLS or SSL/TLS to prevent login information from being intercepted in transit.

Limitations of SMTP
Although SMTP works well, it does have certain limitations, such as
- Does not support data encryption within the content.
- The sender’s identity cannot be verified directly.
- There is no delivery guarantee system.
These issues can be mitigated by using complementary standards such as DKIM, SPF, and DMARC.
SMTP and Supplementary Technologies
SPF (Sender Policy Framework)
This is a method of verifying whether the email-sending server is authorized to send emails on behalf of that domain.
DKIM (DomainKeys Identified Mail)
Use digital signature encryption techniques to verify that the email content has not been altered during transmission.
DMARC (Domain-based Message Authentication, Reporting & Conformance)
Integrate SPF and DKIM to enhance security and prevent phishing.
Example of SMTP Operation
Imagine that we need to send an email from [email protected] to [email protected].
- Alice’s program generates SMTP commands such as HELO, MAIL FROM, RCPT TO, and DATA.
- The SMTP server of example.com receives those commands.
- When the data is ready, it will be forwarded to the SMTP of example2.net.
- Bob opens the email program (using IMAP or POP3) to retrieve the stored information.
Setting Up SMTP in Email Programs
To be able to send emails from any program, users must enter the SMTP settings, which include:
- SMTP server name (e.g., smtp.gmail.com)
- Used Port
- Username
- Password
- Encryption Protocols (SSL, TLS)
SMTP Usage Safety
To secure SMTP, administrators typically:
- Use SSL/TLS encryption
- Require identity verification (SMTP AUTH)
- Use SPF, DKIM, and DMARC.
- Review the usage log to identify any suspicious activity.
Summary:
SMTP is the backbone of the global email system. Despite some limitations, it can provide highly secure and efficient communication when used in conjunction with supplementary technologies.

ไทย