How email Works

Electronic mail, most commonly referred to as email or e-mail since 1993 is a method of exchanging digital messages from an author to one or more recipients. Email operates across the Internet or other computer networks.

Some early email systems required the author and the recipient to both be online at the same time, in common with instant messaging. Today’s email systems are based on a store-and-forward model. Email servers accept, forward, deliver, and store messages. Neither the users nor their computers are required to be online simultaneously; they need connect only briefly, typically to a mail server, for as long as it takes to send or receive messages.

So lets understand the basics of how email works can make life a lot easier for any email user. Especially those who are interested in using email effectively. In this post I will cover how email works, the basics and that every user should know.

Email Servers

Email servers are responsible for receiving, storing, forwarding, and delivering messages to and from email users. Messages are exchanged between servers using the SMTP protocol with various MTAs (Mail Transfer Agents) such as Sendmail, Postfix, qmail, or Exim. Messages can be stored on the server for the user to access, they can be downloaded and stored in the email client for offline use, or stored in both places.

When an email server accepts a message it is obliged to deliver it, or otherwise return a delivery failure message to the sender. This ensures that an email message cannot disappear into thin air and implies that the sender of an email can trust the integrity of the email system.

Occasionally a message can be neither delivered nor returned, usually as a result of a spam message to a non-existent recipient from a falsified sender address.

There are two main types of email servers (see for more details):

  • POP (Post Office Protocol) server is a piece of software that gives an email user access to the email stored in the user’s account on that server. The user can download the messages using a MUA (email client) and store the email locally for later viewing.
  • IMAP (Internet Message Access Protocol) server is a software program running on a server that provides full access to all the folders the user has created on the server. The email user can synchronize all the folders and messages on the server with the data stored locally using a MUA with IMAP capabilities.

Email Clients

A user can access the email messages stored on an email server using an email client or Mail User Agent (MUA) such as Outlook, Thunderbird, Eudora Mail, Incredimail or Lotus Notes.

The MUA connects to the email server via POP to download messages from a folder, or the more advanced IMAP protocol to synchronize all messages in the folders that exist on the server. When the user sends a message, the client connects to the server using the SMTP protocol.

Webmail

A Webmail interface is a web-based email service that is accessible in a web browser such as Internet Explorer, Firefox or Chrome. Most email services offer web interfaces to the email stored on the server.

Webmail services are often faster because they access the stored data more directly via a web browser without the user having to download a piece of software that has to be set up and configured locally.

So how email works?

What happens when I click the “Send” button?

First, your client must locate a Simple Mail Transfer Protocol (SMTP) server to send mail through. This will generally be provided by an Internet Service Provider (ISP) or the host for the domain that the email address belongs to. The client knows how to find this server because the server’s name or IP address was entered in the client’s configuration for the sending address.

Passing the message to the SMTP server is roughly equivalent to walking a letter down to the corner post box and dropping it in. As far as you are concerned it’s sent. Similarly, after passing the message to the sending SMTP server, your email client will say something like “Message sent successfully” because at that point its job is done.

One major difference between the mailing a letter and sending an email message is that an email message can have multiple recipients. If you want to send many copies of a letter using “snail mail” you have to make a lot of copies and address a lot of envelopes. With email you just use one “envelope” with a lot of addresses.

What do the servers do?

After the SMTP server accepts the message from your client it works its way through all of the recipients (everyone with a “To:” or a “Cc:” or a “Bcc:”) and tries to deliver the message to each one. This is where the Domain Naming System (DNS) and specifically Mail Exchanger (MX) Records come in. The sending SMTP server has to consult the DNS MX records for each recipient’s domain to find out where to send the message. This is similar to your local post office sorting your letters for delivery to your local post office.

Hopefully after locating and attempting to deliver to the mail servers for all of the domains in the recipient list the sending server’s job will be over. But, if it is unable to deliver to any of the recipients you will get a message from it (usually as “mailer-daemon”) letting you know it couldn’t deliver for one or more recipients.

If this happens you need to make sure you spelled the address right and/or call the recipient and find out if they’re still using the address. Once you figure out what went wrong you have to start all over for that recipient. (Luckily you can probably find the message in your “Sent” folder and re-send it instead of rewriting the whole thing).

Setting aside possible delivery failures, once your message is delivered to the recipient’s server the receiving server has to figure out how to route it internally. Depending on the size of the domain’s operation the message may have to be routed through several internal servers (think large email providers like Yahoo or Hotmail) before it gets to the recipient’s “mailbox”, or, it may go straight to a “mailbox” on the machine that received it. Either way, it eventually ends up in a “mailbox” file (or directory) and there it stays until it is picked up by the recipient’s Email Client.

In “snail mail” terms, this is like when a letter gets to your local post office and they deliver it to your mailbox.

What happens when I click “Get Mail”?

With “snail mail” the postal service delivers letters to your mailbox. If you want to read the letters you have to get them out of your mailbox and open them. With email, if you want to read your messages, you have to use an email client to pick them up off the server.

When you click “Get Messages” or “Check Mail” or whatever your client labels this operation, the client connects to the mailbox and downloads your messages. This is usually accomplished using Post Office Protocol (POP or POP3). It can also be done using Internet Mail Access Protocol (IMAP) but this is less common.

As with the SMTP connection used for sending, the email client knows how to find the POP, POP3 or IMAP server because you (or whoever set up your client) gave it this information when the address was configured. By default, most email clients will download new messages to your computer and delete them from the server. (If you want to, you can configure your client to leave messages on the server so that other clients, possibly a home computer or a Blackberry, can have a chance to retrieve them).

Once the messages are downloaded they show up as “new” or “unread” messages in your “Inbox” and you can interact with them (i.e. Read, Reply, Forward, Delete, etc.). If you choose to reply or forward the cycle described here is repeated, otherwise the process is finished.

The below diagram explains the the email journey step by step.

email_journey

Please leave your comments below with your thoughts.

Nik

Experienced IT Consultant working and living in the UK. In early years he was born and raised up in Greece and been to the UK since studies. He is passionate with technology, gadgets and computers, he really likes the internet and IT in general.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *