Email is among the widely used communication channel, and most internet system uses Simple Mail Transfer Protocol SMTP to transfer email from their server to the recipient’s server.
It’s a standard communication protocol used by mail servers and other message transfer agents and can impact the deliverability of your campaigns.
This guide will discuss what SMTP is and how it works in the email marketing landscape.
Table of contents
What is a protocol?
A protocol consists of a set of rules and procedures which govern the exchange of data between two or more devices. Protocols define how data transmission will occur between electronic devices such as computers. They set the standard procedures for communication and the exchange of information.
The International Organization for Standardization established the Open Systems Interconnection (OSI). One such widely used Internet protocol lays down the standard for communication over different networks. The model divides the process of data transmission into a series of seven layers.
Important internet protocols are TCP/IP, HTTPS, DNS, and SMTP.
Get the State of Email 2024 Report
150+ email experts share their email tips and secrets
What is SMTP?
Simple Mail Transfer Protocol (SMTP) is an email communication protocol that is used by mail servers to send emails from one account to another via the internet.
How does SMTP work?
The Transmission Control Protocol (TCP) is the primary connection for communication between the mail sender and the mail receiver. In SMTP, the mail sender sends the data in command strings over this reliable ordered data stream channel.
The SMTP client, the initiating agent, sender, or transmitter, initiates the communication session. It issues the command strings and opens the session for corresponding responses from the SMTP server, which involves the listening agent or receiver. Zero or more SMTP transactions may be there in a course.
Usually, an SMTP email transaction follows four command or reply sequences:
It tells the email server that the client wants to start the mail transaction. The client mentions its domain name after this command.
It lays down the bounce address/return address, defining the return or reverse paths.
It specifies the recipient of the message. The sender’s envelope contains the addresses of the recipients, to which the RCPT command can be issued multiple times for each recipient.
It shows where the content of the message starts, as opposed to its envelope. An empty line separates the message header and body in the message’s text.
DATA is not just one command but a group of commands in which a server has to reply twice.
First, the server acknowledges the message and replies with its readiness to take the message.
Then after completing the end-of-data sequence, it either accepts or rejects the entire message.
Apart from the reply of the DATA command, the server can reply in a positive way (2xx reply codes) or a negative way.
The negative responses can further be permanent (5xx codes) or transient (4xx codes).
If a server sends ‘reject,’ then it is a permanent failure, and the client needs to send a bounce message to the respective server. On the other side, a ‘drop’ is a positive reply in which the message is discarded instead of delivered.
Related guide: All About Hard Bounce & Soft Bounce
Take a look at a sample exchange between sending server and the receiving server.
|Identifies itself with the domain name or IP address to start the conversation
|MAIL FROM email@example.com
|Specifies the sender of the email
|RCPT TO firstname.lastname@example.org
|Specifies the recipient of the email
|Request to start the transfer of email contents, date, subject line, etc.
|Allows the sender to start the transfer of information
|Date: Sunday, 30 July 2023
|Date of the email
|Subject: Welcome to the party!
|Subject of the email
|We welcome you to the party. We hope to have a lot of fun together
|Content of the email
|Terminates the transfer of email contents
|Request to terminate the session
Difference between SMTP, IMAP, & POP3
Although these three protocols are used for email delivery, they still possess a few key differences.
SMTP is an email protocol used by mail servers use to send emails over the internet. It sets the rules for other email servers on error handling. Email behemoths like Gmail and Outlook use SMTP protocol to deliver billions of emails daily. The drawback of this protocol is that there isn’t a built-in mechanism for authenticating the sender’s identity, leaving users vulnerable to spoofing attacks. That’s why, you must set up SPF, DKIM, and DMARC records that help email servers authenticate your emails.
IMAP is an email protocol that is used to retrieve emails from an email server. With this protocol, you will be able to access the email content but can’t download it to your local machine. The email content will stay in the email server and can be accessed from any device.
Finally, the POP3 is an email protocol that is also used to retrieve emails. But it differs from the IMAP due to its ability to download emails from mail servers to your local machine. The only caveat is that the email will be removed from the mail server and will remain accessible on the downloaded local machine.
Related guide: POP3 vs IMAP: Which One Should You Use
Get a sample AMP email in your inbox
Experience the power of interactivity right now
What are the components of SMTP?
There are two primary components of the SMTP client and SMTP server:
Mail transfer agent (MTA)
The User-Agent (UA) is responsible for preparing, creating, and putting the message in the form of an envelope for transmission.
Mail Transfer Agent (MTA)
The Mail Transfer Agent (MTA) then transfers this message to the recipient across the internet.
The SMTP servers support a more complex system by adding a relaying system. Under this, more MTAs can be placed at either sending or receiving sides.
In addition, this SMTP relay system can use mail gateways and work without TCP/IP protocols if needed.
What are the types of SMTP?
The different types of SMTP are:
1. End-to-end SMTP
In the SMTP model, the client-SMTP starts the communication session, whereas the SMTP at the receiver’s side responds to the client’s request. The end-to-end SMTP protocol helps send emails to servers at various other organizations. This model acts as a medium of communication between different organizations.
2. Store-and-forward SMTP
The store-and-forward SMTP model is different from the end-to-end SMTP model. The store-and-forward type is used within an organization only, unlike the end-to-end SMTP.
After contacting the destination’s host directly, the SMTP server keeps the mail to itself until the receiver’s SMTP successfully receives a copy of the email.
How are emails sent using SMTP?
The process of sending emails via SMTP port consists of the following sequential steps:
With the help of a Mail Transfer Agent (MUA) program, the user sends an email. The content of the email consists of two parts, the email header and the email body.
The header is the message’s subject, while the body is the main content. The sender and recipient address also comes under the header part. The header acts like an envelope holding the letter (message).
The mail client (mail user agent, MUA) submits the email to a mail server (known as a mail submission agent, MSA) using SMTP on TCP port 587 or the traditional port 25. The MSA further delivers the mail to its mail transfer agent, MTA.
3. Mail delivery
The two parts of an email address are the recipient’s username and the domain name.
In case the domain name of the recipient’s email address does not match the sender’s domain name, then the mail submission agent (MSA) will send the mail to the (MTA). The MTA will search for the particular domain to relay the mail. IT happens in two steps:
- First, it checks the MX record from the Domain Name System (DNS) to obtain the target domain. The MX record contains recipients’ domain names and IP addresses.
- Once it locates, MTA establishes the connection with the exchange server and relays the message.
This email transfer from one SMTP server to another is called an SMTP relay. And to keep your emails delivered smoothly with high deliverability, you may need SMTP relay services. Unlike other email clients like Gmail and Outlook, SMTP relay services make sure that your emails are delivered even if they’re in large volume.
Related guide: SMTP Relay: What Is It and How Does It Work
4. Receipt and processing
After receiving the incoming message, the exchange server delivers it to the Mail Delivery Agent. Then, it stores the email and waits for the retrieval by the user.
5. Access and retrieval
The user can access the MUA with the login and password. In addition, the MUA helps retrieve the stored email from the MDA.
SMTP for Gmail and Outlook
Here are the steps for accessing your emails Gmail and Outlook emails on any email clients using SMTP.
SMTP for Gmail
Gmail makes it quite easy to access its emails from other email clients like Microsoft Outlook and Apple Mail. Here are the steps you need to follow to access your Gmail emails from any email client.
From the top right corner, go to Settings > See all settings.
Go to the Forwarding and POP/IMAP tab.
In the "IMAP Access" section, select Enable IMAP.
Click on Save Changes.
Enter the required information in your email client according to the table below to access emails of Gmail.
|Incoming Mail (IMAP) Server
|Outgoing Mail (SMTP) Server
|Yes (if available)
|Port for SSL
|Port for TLS/STARTTLS
|Full Name or Display Name
|Account Name, User name, or Email address
|Your full email address
|Your Gmail password
SMTP for Outlook
Here are the setting you need to follow to set up and access Outlook emails on any email client.
Go to Settings > View all Outlook settings > Mail > Sync email.
Under POP and IMAP, select Yes under Let devices and apps use POP.
Click on Save.
Enter the required information in your email client according to the table below to access emails of Gmail.
|IMAP server name
|IMAP encryption method
|POP server name
|POP encryption method
|SMTP server name
|SMTP encryption method
Origin of SMTPs and popular SMTPs
In 1982, Sendmail with 4.1cBSD, one of the first MTAs to implement the Simple Mail Transfer Protocol, was released. With time, it became a commonly used mail transfer agent.
Some other SMTP server programs that have become popular include:
In 1998 and 1999, new trends in the delivery of emails and the introduction of the Message submission (RFC 2476) and SMTP-AUTH (RFC 2554), respectively.
SMTPs are essential for sending and receiving emails. However, as an email marketer, you need to choose and configure the SMTP service providers that suit your requirements.
At Mailmodo, we provide easy SMTP setup and integration with any SMTP servers you might like to send your email marketing campaigns. Feel free to reach out to the Mailmodo team to learn more or check out our SMTP setup help guide.