Email marketing is effective when done right. Since emails go through a complex journey after we hit ‘Send,’ we need to know what happens as they travel.
Behind the scenes, an email goes through a complex journey that consists of several steps. And each step is defined by the email protocol being used. Depending on the email protocol, our emails will go through more or fewer stages before they reach the recipient's inbox.
Keep reading to see email protocols explained.
Table of contents
- What are email protocols?
- How are emails being sent?
- SMTP and its workflow
- IMAP and its workflow
- POP3 and its workflow
- How to choose the right protocol?
- Choosing the retrieving email protocol
What are email protocols?
A protocol is a set of rules that defines how a process should or should not take place. An email protocol, in turn, is a collection of rules that define how communication between servers and email clients happens.
Since different email clients and servers support the same email protocols, people using different email clients and devices can send and receive emails from one another — it’s a free and useful solution to make email accessible for all of us.
How are emails being sent?
While we receive or send an email within a few seconds, the journey of an email actually involves different participants and consists of several steps. In particular, there are 3 parties that take part in sending or receiving an email:
- Sender’s email client
- Mail server
- Recipient’s email client
So the email travels from the sender to the mail server and then to the recipient. The mail server acts as an intermediate between the email clients of the sender and the recipient and authenticates emails.
In turn, these three parties are connected by email protocols like SMTP, IMAP or POP3.
Let’s discuss an example to see that using protocols for sending and receiving email is a highly effective strategy. The process of sending an email from
firstname.lastname@example.org would look like the following:
- Gmail, the sender’s email client, connects to Gmail’s SMTP server.
- The SMTP server confirms that the email can be sent (authenticates it) by authorizing the sender’s and recipient’s email addresses.
- Gmail’s SMTP server sends the email to Outlook SMTP server.
- Outlook SMTP server authenticates the recipient’s email address.
- Outlook SMTP server sends the email to the Outlook email client through IMAP or POP3.
And as a result of this complex process, we either get a successfully delivered email or an error message. The latter can occur for many reasons, like the recipient’s address is invalid or the receiving server is not responding.
So how exactly are emails sent and what do you need to know about email protocols when comparing POP3 and IMAP to SMTP?
SMTP and its workflow
Simple Mail Transfer Protocol (SMTP) is a standard email sending protocol. In particular, SMTP connects an email client and an internet server, as well as two internet servers, to transfer the message from the first to the latter. Then, an email message can move toward the recipient’s inbox.
SMTP servers can be of two types:
- Relays receive the email message and transfer it further (to the SMTP receiver service)
- Receivers get the message (from the SMTP relay service) and deliver it to the recipient’s retrieving server
With this being said, SMTP is used for outbound emails, in comparison to IMAP and POP3.
To set up your SMTP server, you have to fill in SMTP configurations in your mail client’s account settings or your code. The configurations include the hosting server’s name, port, user name and other data.
When an SMTP server is set up and ready for use, the communication between the SMTP client and the SMTP server can start. The communication occurs in 3 stages:
1. The SMTP client connects to the SMTP server, which is called an SMTP handshake.
2. The email message transfer between the two parties starts — email transfer.
3. The connection between the SMTP client and the SMTP server ends — termination.
The communication between the client and the server takes place through an exchange of text-based commands. Here are some of the commands the client sends to the SMTP server:
- MAIL FROM
In turn, the SMTP server responds to the client with numeric codes like the following:
Each code signals for a confirmation of a command or an error, as well as there are separate codes for handshake and termination.
There are different SMTP ports that serve different purposes — for example, port 25 is for email transfer from one email server to the other, while port 587 is for email submission.
Learn more about SMTP ports in this blog post.
IMAP and its workflow
Internet Message Access Protocol (IMAP) is an email receiving protocol. IMAP keeps emails on the server after they are delivered. In other words, you can only access your emails when you’re connected to the internet.
Initially, only the sender’s name, the date of when the email was delivered and the subject of the email are downloaded and accessible. The rest of the email’s contents are downloaded after the recipient opens it.
Because emails are stored on the server, one can access emails from as many devices as needed at the same time. When there are any changes to the email after it is delivered, like the email is deleted or read, the change is logged on the server. This makes the inbox synced and up-to-date across all devices.
Besides, emails received through IMAP don’t take up space on the devices because they’re stored on the server.
As for the IMAP workflow, it consists of communication between the recipient’s email client and the IMAP server. The communication happens in 3 stages:
- The email client of the recipient establishes a connection with the IMAP server.
- The basic information of all emails is retrieved to the recipient’s inbox.
- A recipient opens an email message, and IMAP downloads its content to display it fully.
In the same way, all other changes to the recipient’s emails are reflected on the server and in the inbox.
There are 2 IMAP ports:
- 143 — a standard port with no encryption
- 993 — a commonly used port secured with SSL/TLS
The latter port is also known as the IMAPs port.
POP3 and its workflow
Post Office Protocol (POP) is another email receiving protocol. The “3” stands for the 3rd version of the protocol.
POP3 allows users to access their emails without any access to the internet because it downloads the full email to the user’s device as soon as it is delivered. Then, the email is deleted from the server. This is the main difference between POP vs IMAP.
Naturally, changes that occur in the user’s inbox, like new or deleted emails, can be reflected on other devices only after the device is connected to the internet again.
The POP3 workflow consists of the following steps:
- The connection between the email client and the POP3 server establishes — authorization.
- The client gets the email — transaction.
- The stored messages are deleted from the server — update.
- The client disconnects from the server.
The communication between the email client and POP3 server occurs based on commands like “user [user’s name]” and “password [user’s password]”.
The server, in turn, can either confirm the action or notify of an error with replies “+OK” and “-ERR,” respectively. Text-based messages can also be the server’s replies if the client requests particular information.
Similarly to IMAP, there are only 2 POP3 ports:
- 110 — a standard port with no encryption
- 995 — a commonly used port secured with SSL/TLS
The 995 port is also known as the POP3S port.
How to choose the right protocol?
So there are 3 email protocols, each functioning in a different way. How do you choose between them and go with the right one for you? Let’s compare POP3 vs IMAP and SMTP to identify the differences between them.
SMTP: Pros and cons
The biggest advantage of using an SMTP protocol is that it is universally adopted. This makes it easy to set up and use regardless of your email client. Besides, some other pros of using SMTP are:
- You only need your credentials to run SMTP
- SMTP provides the dependability of your outbound mail
- In case of an error, SMTP keeps resending your email until it is sent successfully
- Debugging is simple because you get a detailed explanation of why an error occurred
- You can set up a fake SMTP relay server to test your email campaigns
The disadvantages of SMTP:
- A low level of security, meaning that it can be easily hacked
- Server limitations make SMTP not suitable for bulk campaigns
- Ports that SMTP uses are often blocked by firewalls
- Long email messages are rejected
- Binary files need to be converted into text files to be sent via SMTP
- Because of the numerous back-and-forth communication between the servers, SMTP takes more time to send an email
IMAP vs POP3
POP3 and IMAP are both retrieving email protocols — they receive the message from the email server and send it to the recipient’s email client so that the email appears in the recipient's inbox.
But email POP vs IMAP work in different ways. While IMAP requires an internet connection to deliver messages that are stored on the email server, POP3 downloads emails to the recipient’s device, making them available offline.
Let’s discuss the differences between IMAP and POP3 email protocols in detail.
IMAP: Pros and cons
The pros of IMAP are the following:
- The device’s storage is not affected because emails are kept on the server
- For the same reason, there is no risk of data loss if the device crashes
- The messages appear the same after changing email clients
- Users can read emails from multiple devices at the same time
The main con of using IMAP, in turn, is that you depend on your internet connection. With this being said, IMAP’s disadvantages imply that:
- You can’t access old messages unless you’re online
- It takes more time than POP3 to load messages because of the synchronization
- You’ll need to get more server storage if you use email a lot
POP3: Pros and cons
POP3 is a retrieving email protocol, too. When comparing POP vs IMAP in terms of what task they perform, it’s the same, namely to retrieve the message from the email server to the email client. But with POP3, full messages are stored on local machines instead of the server.
The pros of using POP3 vs IMAP include:
- No dependency on the internet connection — emails are available on the device at all times
- Easy to manage all emails through a single interface
And the cons of POP3 vs IMAP are the following:
- Viruses that come with emails can easily affect the device
- High chances of data loss in case the device crashes
- Device storage limitations may affect message retrieval
Choosing the retrieving email protocol
Because POP email vs IMAP are both retrieving email protocols, you will most likely be choosing between these two. So let’s discuss when you should choose which.
Go for IMAP email protocol if:
- you’re going to use the email client from different devices
- you’re constantly connected to the internet
- you travel often and need to have access to your email at all times
- you get a lot of emails and don’t want to worry about running out of storage
And choose POP3 if:
- you don’t use your email that much
- your internet connection is unstable
- you want a lot of privacy in your email access and use a single device to access it.
To wrap up
Email protocols are an essential asset when it comes to sending and receiving emails. There are different types of email protocols that serve different purposes. Now that we’ve compared POP3 vs IMAP vs SMTP, you know when to choose which for your email protocol setup.
Monitor Your Entire Application with Atatus
Atatus is a Full Stack Observability Platform that lets you review problems as if they happened in your application. Instead of guessing why errors happen or asking users for screenshots and log dumps, Atatus lets you replay the session to quickly understand what went wrong.
We offer Application Performance Monitoring, Real User Monitoring, Server Monitoring, Logs Monitoring, Synthetic Monitoring, Uptime Monitoring, and API Analytics. It works perfectly with any application, regardless of framework, and has plugins.
Atatus can be beneficial to your business, which provides a comprehensive view of your application, including how it works, where performance bottlenecks exist, which users are most impacted, and which errors break your code for your frontend, backend, and infrastructure.
If you are not yet an Atatus customer, you can sign up for a 14-day free trial.