SMTP stands for Simple Mail Transfer Protocol. It is the standard set of rules that email programs and mail servers use to send messages across the internet. If you searched for the "full form of SMTP in computer", that is the answer: Simple Mail Transfer Protocol, defined today in RFC 5321. This guide explains what each word means, how an SMTP conversation works, what the commands and reply codes look like, which ports SMTP uses, and how SMTP differs from IMAP and POP3.
SMTP full form and meaning
The three words describe the job. Simple refers to the design: SMTP is made of short text commands and short numeric replies that a person can read. Mail Transfer says what it does: it moves mail from one system to the next. Protocol means that it is a set of rules, so software from different makers can work together. The first version appeared in 1982 as RFC 821, and the current specification is RFC 5321 from 2008.
SMTP is a push protocol. The sender connects and pushes the message towards its destination. It does not let you read or download mail from a mailbox. For that, you need IMAP or POP3, which our article on IMAP vs POP3 vs SMTP compares.
What SMTP does
When you press Send, your email program or application hands the message to an outgoing mail server over SMTP. That server looks up where the recipient's domain receives mail, connects to it over SMTP, and passes the message on. The receiving server stores it in the recipient's mailbox. Several servers may handle the message along the way, and each hand-over is an SMTP conversation. The software that performs these hand-overs is a mail transfer agent; read about the mail transfer agent to see how it fits together.
An SMTP conversation, step by step
An SMTP session is a short dialogue. The lines starting with S are from the server, and those starting with C are from the client. This is a simplified example with placeholder names.
S: 220 mail.example.net ESMTP ready
C: EHLO app.example.com
S: 250-mail.example.net
S: 250-STARTTLS
S: 250 AUTH PLAIN LOGIN
C: STARTTLS
S: 220 Ready to start TLS
(encrypted connection begins)
C: AUTH PLAIN ...
S: 235 Authentication successful
C: MAIL FROM:<[email protected]>
S: 250 OK
C: RCPT TO:<[email protected]>
S: 250 OK
C: DATA
S: 354 Start mail input
C: Subject: Hello
C: ...message body...
C: .
S: 250 Message accepted
C: QUIT
S: 221 Bye
| Command | What it does |
|---|---|
| EHLO (or HELO) | The client introduces itself. EHLO also asks the server to list its extensions |
| STARTTLS | Asks to switch the connection to encrypted TLS |
| AUTH | Logs in with a user name and password or key |
| MAIL FROM | Names the envelope sender, where bounces go |
| RCPT TO | Names one recipient; repeated for each recipient |
| DATA | Begins the message itself: headers and body, ending with a line holding a single dot |
| QUIT | Ends the session |
SMTP reply codes
Every server reply begins with a three-digit code. The first digit tells you the category, which is often enough to know what to do.
| Code range | Meaning | Example |
|---|---|---|
| 2xx | Success | 250 OK, 235 authenticated |
| 3xx | The server wants more input | 354 start mail input |
| 4xx | Temporary failure: try again later | 421 service unavailable, 451 try later |
| 5xx | Permanent failure: do not retry unchanged | 550 mailbox unavailable, 554 rejected |
Our guide to SMTP error codes explains the common ones and how to respond, and email bounce types covers what they mean for your list.
SMTP ports
| Port | Used for | Notes |
|---|---|---|
| 25 | Server-to-server delivery | Often blocked for end users and cloud hosts to limit abuse |
| 587 | Message submission from apps and mail clients | The usual choice, with STARTTLS required |
| 465 | Submission over implicit TLS | Encrypted from the first byte, described in RFC 8314 |
| 2525 | Unofficial alternative submission port | Used when 587 is blocked, only if your provider offers it |
Read SMTP settings, ports and authentication for the full settings, and email SSL and TLS for the encryption options.
SMTP, IMAP and POP3: who does what
- SMTP sends mail from a client to a server, and between servers.
- IMAP lets a client read and manage mail that stays on the server. See what IMAP is.
- POP3 downloads mail from the server to one device, usually removing it from the server.
A typical mail account setup needs both an outgoing server (SMTP) and an incoming server (IMAP or POP3).
SMTP does not prove who sent a message
The base protocol lets a sender claim any From address, which is why spoofing is possible. Three DNS-based checks add proof: SPF lists which servers may send for a domain, DKIM signs messages cryptographically, and DMARC tells receivers what to do when those checks fail. Any application that sends email should set all three up.
Using SMTP in your own application
You rarely type SMTP commands by hand. Libraries and frameworks do it for you. You provide four values: a host name, a port, a security mode and credentials. If you do not want to operate your own server, use an SMTP service. See SMTP servers vs SMTP services and our SMTP relay. You can test a connection from the command line:
openssl s_client -connect smtp.example.com:587 -starttls smtp
The host name is a placeholder. A successful run shows the certificate and then the server's greeting, after which you can type EHLO by hand to see the extensions it offers.
Never send credentials without encryption. Use STARTTLS on port 587 or SSL/TLS on port 465, and make the client refuse to continue if encryption cannot be set up.
A short history of SMTP
Email existed before SMTP. Early systems moved messages between users of the same computer, and later between machines using a variety of one-off methods. SMTP was published in 1982 as RFC 821 so that different networks and systems could exchange mail with a common method. It was revised in 2001 as RFC 2821 and again in 2008 as RFC 5321, which is the version in force. The word "Simple" was meant seriously: a basic implementation fits in a few hundred lines. The protocol has stayed recognisable for more than forty years because the core idea, a short text dialogue, works.
ESMTP: the extensions that made SMTP practical
The original protocol had no way to log in, no encryption and no way to announce limits. Extensions, together called ESMTP, added them. That is why the modern greeting is EHLO instead of HELO: it asks the server to list what it supports. Common extensions include STARTTLS to upgrade to an encrypted connection, AUTH to log in, SIZE to announce the largest message accepted, PIPELINING to send several commands without waiting for each reply, and 8BITMIME to send text that is not plain ASCII. When you read a server's EHLO reply, you are reading its feature list.
The envelope and the message
SMTP separates the envelope from the message. The envelope, made of MAIL FROM and RCPT TO, tells servers where to deliver and where to send bounces. The message, sent after DATA, is what the recipient sees: From, To, Subject and the body. The two can differ, and that is normal. A mailing list, for example, uses its own address in the envelope and keeps the original author in the From header. Many deliverability checks look at how the envelope and headers line up. Read our guide to email header fields to see each one.
Need to send email from your application over SMTP? We can help you set up credentials, authentication and a first test message, so you can see how SMTP works with a real connection.
References and further reading
Frequently asked questions
What is the full form of SMTP?
SMTP stands for Simple Mail Transfer Protocol. It is the standard protocol that email programs and mail servers use to send messages, defined today in RFC 5321.
What does SMTP do?
It moves email from a sender's program to an outgoing server, and from server to server until the message reaches the recipient's mail server. It does not let you read mail from a mailbox; IMAP and POP3 do that.
Which ports does SMTP use?
Port 25 is used for server-to-server delivery, port 587 for message submission with STARTTLS, and port 465 for submission over implicit TLS. Some providers also offer 2525 as an alternative when 587 is blocked.
What is the difference between SMTP and IMAP?
SMTP sends mail. IMAP lets a client read and manage mail that stays on the server. A mail account normally needs both: an outgoing SMTP server and an incoming IMAP or POP3 server.
What do SMTP reply codes mean?
The first digit gives the category: 2xx is success, 3xx means the server wants more input, 4xx is a temporary failure that you can retry, and 5xx is a permanent failure.