Differences Between IMAP vs. SMTP

Differences Between IMAP vs. SMTP

Since its invention in 1971, Email has grown to become one of the most widely used forms of online communication. In fact, a report by Statista shows that as of 2020, 306.4 billion emails were sent and received daily. This figure is expected to reach 347.3 billion in 2023.

At the heart of email technology are the Internet Message Access Protocol(IMAP) and Simple Mail Transfer Protocol(SMTP) which are protocols used to send and receive emails. Protocols are a set of rules and standards that govern how devices communicate with each other over a network. Therefore, IMAP and SMTP are rules and standards that govern how emails are sent and received.

With the ubiquity of emails particularly in business communications, it is crucial to understand how IMAP and SMTP work. This is useful in troubleshooting email issues, understanding email automation systems, writing custom email server scripts and setting up email clients.

What is IMAP?

IMAP is a protocol used to receive and manage emails from a mail server. IMAP saves emails on remote mail servers providing access to the emails from multiple devices or locations simultaneously. Additionally, IMAP allows searching, grouping, and deletion of messages and setting of message flags. It also supports the creation of multiple mailboxes and sends push notifications to users whenever changes happen in their mailboxes.

To use IMAP, a client connects to the IMAP server with their messages. New emails are then fetched and stored as temporary files on a device. At first, IMAP only fetches the subject, date, and sender of the emails. The contents are fetched after an email is opened and even then, attachments are not downloaded automatically.

Reading an email using IMAP does not download the email to a device. Instead, emails are read directly from the email service provider. This means that any changes made to an email are reflected on the mail server and seen on all devices accessing the mailbox.

What is SMTP?

SMTP is a protocol used to send emails from an email client such as Gmail to an email server. SMTP is also used to send emails between mail servers which is important when the sender and recipient are using different email service providers.

To use SMTP an email client establishes a connection with an SMTP server and sends the commands HELO or EHLO to identify itself and initiate an SMTP conversation. If the server is ready to receive a message it responds with a ‘250 OK’ message. Upon receiving a go-ahead, the client sends the sender's email address, the receiver's email address and the data contained in the email. This is done using the SMTP protocol. Once everything is sent, the connection between the server and the client is terminated.

The server then delivers the message to the recipient's mailbox or sends it to another server using SMTP, in case the recipient’s mailbox is stored in a different mail server.

How do IMAP and SMTP work altogether?

To see how IMAP and SMTP work together to send and receive emails, let's look at the path followed by an email sent from Dave’s email, dave@gmail.com to Jane’s email, jane@yahoo.com.

First, Dave’s email client establishes a connection with his SMTP mail server. The SMTP protocol is then used to send Dave and Jane’s email addresses and the content of the email to Dave’s mail server which will deliver the message to Jane’s mailbox.

Since Dave and Jane are using different email service providers, their mailboxes are stored on different mail servers. To deliver the message to Jane, Dave’s mail server connects with Jane’s Yahoo mail server and sends Dave’s message using SMTP. Jane’s mail server receives the message and stores it in her mailbox.

To access the email sent by Dave, Jane's email client will use the IMAP protocol to fetch the email from Yahoo’s mail server and make it available to Jane’s inbox, where it can be read, replied to, or deleted.

Working with an SMTP server

An SMTP server sends and delivers messages to intended recipients. Working with an SMTP server allows users to send bulk emails with a high delivery rate.

When sending bulk emails, an SMTP server relay service routes emails through trusted third parties to deliver high volumes of emails. This ensures that a company’s domain or mail server is not blacklisted resulting in emails ending up in the spam folder or not being delivered entirely.

A great SMTP performs verification, prevents spamming, and protects a sender's internet protocol(IP) address reputation. This in turn enhances the effectiveness of email strategies by improving efficiency through high delivery rates, low bounce rates, and the ability to monitor the performance of email strategies.