How does Email actually work?

Mufi Mash
2 min readAug 4, 2019

Take a look at the below diagram

Jane wants to send an email to Aaron. Jane uses a Gmail address and Aaron uses Hotmail.

Multiple protocols work together to ensure the emails are delivered and received.

1. Jane’s PC first talks to the Gmail Server and tells that it wants to send an email to Aarons’ Hotmail account

There are few protocols that come into play at this point;

SMTP (Simple Mail Transfer Protocol) is the protocol for sending emails

and

IMAP (Internet Access Message Protocol) protocol for receiving emails.

Why do we need these protocols? Just like we humans understand English language, computers need a methodical way to talk to each other. These protocols are defined to send, receive and organize emails. These protocols are running on both Jane’s machine (aka Client) and Gmail Servers.

2. Next, Gmail Server will use SMTP to talk to Hotmail Server. SMTP Protocols are used to send mails, reject mails. For Example:- if the recipient address is incorrect. SMTP protocol in the Recipients server will alert the Senders server about it.

3. After the mail reaches “Server Hotmail” and the SMTP protocol accepts the mail, the server will communicate with Aarons mail client / PC via IMAP protocol. As a result of this communication, Aaron receives the mail sent by Jane.

Note :

These communications happen only if the Client’s machines are connected to the Internet.

Each mail server (e.g. Gmail mail server, Hotmail mail server) has a unique IP address, in addition to the IP address, there are ports in each device. Think of “IP address” as a unique Building ID and a “Port” as an apartment in the building. A mail server listens on port 25 to receive emails via TCP (Transmission Control Protocol) protocol.

Each PC/smartphone that you use to send or receive emails also has an IP address. These IP may or may not be unique. They need to be unique within an organization (if it is accessed from the office) or within an ISP (Internet Service Provider, e.g. Verizon or AT&T) (if you are accessing from home or through a mobile network).

--

--