Email Marketers’ Guide to SMTP (Simple Mail Transfer Protocol)

Aquibur Rahman
ByAquibur Rahman

10 mins read

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.

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.

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.

How SMTP works: Sender's server to internt to receiver's mail server

Usually, an SMTP email transaction follows four command or reply sequences:

HELO/EHLO command

It tells the email server that the client wants to start the mail transaction. The client mentions its domain name after this command.

MAIL command

It lays down the bounce address/return address, defining the return or reverse paths.

RCPT command

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.

DATA

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.

From Command Meaning
Sending server HELO client.gmail.com Identifies itself with the domain name or IP address to start the conversation
Receiving server 250 OK
Sending server MAIL FROM mark@gmail.com Specifies the sender of the email
Receiving server 250 OK
Sending server RCPT TO clair@yahoo.com Specifies the recipient of the email
Receiving server 250 OK
Sending server DATA Request to start the transfer of email contents, date, subject line, etc.
Receiving server 354 Allows the sender to start the transfer of information
Sending server Date: Sunday, 30 July 2023 Date of the email
Sending server Subject: Welcome to the party! Subject of the email
Sending server Empty line
Sending server We welcome you to the party. We hope to have a lot of fun together Content of the email
Sending server . Terminates the transfer of email contents
Receiving server 250 Ok
Sending server QUIT Request to terminate the session
Receiving server 221 Closing session

Maximize your email performance with our free ebook

Optimize the right email metrics for higher ROI

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

What are the components of SMTP?

There are two primary components of the SMTP client and SMTP server:

  1. User-agent (UA)
  2. Mail transfer agent (MTA)

User-Agent (UA)

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.

Components of SMTP

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:

1. Composition

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).

2. Submission

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.

For example, mayank@gmail.com, ‘Mayank’ is the username, and ‘gmail.com’ is the domain.

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.

Get the State of Email 2024 Report

150+ email experts share their email tips and secrets

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.

  1. From the top right corner, go to Settings > See all settings.

  2. Go to the Forwarding and POP/IMAP tab.

  3. In the "IMAP Access" section, select Enable IMAP.

  4. Click on Save Changes.

  5. Enter the required information in your email client according to the table below to access emails of Gmail.

Configuration property Value
Incoming Mail (IMAP) Server imap.gmail.com
Requires SSL Yes
Port 993
Outgoing Mail (SMTP) Server smtp.gmail.com
Requires SSL Yes
Requires TLS Yes (if available)
Requires Authentication Yes
Port for SSL 465
Port for TLS/STARTTLS 587
Full Name or Display Name Your name
Account Name, User name, or Email address Your full email address
Password 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.

  1. Go to Settings > View all Outlook settings > Mail > Sync email.

  2. Under POP and IMAP, select Yes under Let devices and apps use POP.

  3. Click on Save.

  4. Enter the required information in your email client according to the table below to access emails of Gmail.

Configuration property Value
IMAP server name outlook.office365.com
IMAP port 993
IMAP encryption method TLS
POP server name outlook.office365.com
POP port 995
POP encryption method TLS
SMTP server name smtp-mail.outlook.com
SMTP port 587
SMTP encryption method STARTTLS

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:

  1. Postfix
  2. Qmail
  3. Novell GroupWise
  4. Exim
  5. Novell NetMail
  6. Microsoft Exchange Server
  7. Oracle Communications Messaging Server

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.

Some of the most popular SMTP servers include amazon ses, Sendgrid, Mailgun, etc.

Conclusion

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.

What should you do next?

You made it till the end! Here's what you can do next to grow your business:

2_1_27027d2b7d
Get smarter with email resources

Free guides, ebooks, and other resources to master email marketing.

1_2_69505430ad
Do interactive email marketing with Mailmodo

Send forms, carts, calendars, games and more within your emails to boost ROI.

3_1_3e1f82b05a
Consult an email expert

30-min free email consultation with an expert to fix your email marketing.

Table of contents

chevron-down
What is a protocol?
What is SMTP?
How does SMTP work?
Difference between SMTP, IMAP, & POP3
What are the components of SMTP?
What are the types of SMTP?
How are emails sent using SMTP?
SMTP for Gmail and Outlook
Origin of SMTPs and popular SMTPs
Conclusion

Fresh Marketing Ideas, Every Week.

Get the latest marketing roundup & news

Get 3X conversions
with interactive emails

Check.svg

Create & send interactive emails without coding

Check.svg

Put revenue on auto-pilot with pre-built journeys

Check.svg

Save time with AI-powered email content creation

1000+ businesses grew with Mailmodo, including

Frame_1110165681_3_b26b1a7573
Group_1110165532_1_bf39ce18b3
Ellipse_Gradientbottom_Bg
Ellipse_Gradientbottom_Top
gradient_Right