Every day, billions of emails are exchanged by internet users. If you're online frequently, you might send several emails daily without even realizing it. It's clear that email has become a vital and widely used communication tool.
Have you ever wondered how your email travels from your device to someone on the other side of the planet? What exactly is a POP3 server, and how does it store your messages? The answer is surprisingly simple: at its core, email operates through an efficient and straightforward system. In this article, we’ll explore the inner workings of email in detail.
The Email Communication
As highlighted in Darwin Magazine: Prime Movers, the first ever email was sent in 1971 by engineer Ray Tomlinson. Prior to this, messages were limited to being exchanged only between users on the same machine. Tomlinson’s innovation was the ability to send messages across machines on the Internet, using the @ symbol to specify the receiving machine.
An email message has always been essentially a simple text message — a string of text sent to a recipient. Initially, and even still today, email messages tend to be short, though the addition of attachments has made some emails much longer. However, despite the use of attachments, emails remain fundamentally text messages — as we'll explore in the attachments section.
Email Software
You’ve likely received several emails today. To read them, you use an email client. Many people use well-known standalone programs like Microsoft Outlook, Outlook Express, Eudora, or Pegasus. Users of free services like Hotmail or Yahoo access their email via a client embedded in a webpage. If you're an AOL subscriber, you use AOL’s email interface. Regardless of the client, they generally all perform four key functions:
- Displays a list of all messages in your mailbox by showing the message headers, which include the sender, subject, and sometimes the time, date, and size of the message.
- Allows you to choose a message header and read the contents of the email.
- Enables you to create and send new messages. You simply enter the recipient's email address, the subject, and the message body.
- Gives you the ability to attach files to messages you send and save attachments from those you receive.
While advanced email clients may offer many extra features, at their core, these are the fundamental tasks an email client performs.
A Basic Email Server
With an email client installed on your device, you're ready to send and receive emails. The only thing you need is an email server for the client to connect to. Let’s imagine the simplest email server to understand the basics of the process, and then we’ll explore how real email servers work.
If you're familiar with How Web Servers Work, you already know that machines on the Internet can run software programs that function as servers. These include web servers, FTP servers, telnet servers, and email servers, all operating on millions of machines globally. These applications run continuously, listening on specific ports for connections from users or programs. A basic email server operates in a straightforward manner as follows:
- It would maintain a list of email accounts, with each account representing an individual who can receive emails on the server. For example, my account might be mbrain, and John Smith’s could be jsmith.
- It would store a text file for each account, so the server would have files named MBRAIN.TXT, JSMITH.TXT, and so forth in its directory.
- If someone wanted to send me an email, they would compose a simple message ("Marshall, Can we have lunch Monday? John") in an email client and direct it to my account, mbrain. After clicking Send, the email client connects to the server and sends the recipient's name (mbrain), sender's name (jsmith), and the message content.
- The server would then format this information and append it to the end of the MBRAIN.TXT file. The file entry could look like this:
- The server would then format this information and append it to the end of the MBRAIN.TXT file. The file entry might look like this: From: jsmith To: mbrain Marshall, Can we have lunch Monday? John
The server might also store additional details like the time and date of receipt, along with a subject line. But overall, this is a very simple process at its core.
We will explore the SMTP server in more detail in the next section.
Advanced Server Configurations
As more people send emails to mbrain, the server would continue adding those messages to the bottom of the file, in the order they arrive. Over time, the text file would collect multiple messages, and eventually, I would log in to check them. When I wanted to read my emails, my email client would connect to the server and, in the simplest scenario, it would:
- Request the server to send a copy of the MBRAIN.TXT file
- Request the server to clear and reset the MBRAIN.TXT file
- Download the MBRAIN.TXT file onto my local device
- Separate the file into individual messages (by using the word "From:" as a marker)
- Display all message headers in a list
When I double-clicked on a message header, the system would locate that specific message in the text file and display its content.
As you can see, this system is quite simple. Surprisingly, the real email system you use daily is not much more complex than this one.
The True Email System
For most users today, the actual email system relies on two distinct servers operating on a server machine. One is known as the SMTP server, which stands for Simple Mail Transfer Protocol and is responsible for outgoing messages. The other is either a POP3 server or an IMAP server, both of which manage incoming mail. POP3 refers to Post Office Protocol, while IMAP stands for Internet Mail Access Protocol. Here's an overview of how a typical email server looks:
The SMTP server listens on port 25, POP3 on port 110, and IMAP on port 143 (see How Web Servers Work for more details on ports).
The SMTP Server
When you send an email, your email client communicates with the SMTP server to handle the delivery process. The SMTP server on your device may even interact with other SMTP servers to ensure the email reaches its destination.
Imagine I want to send an email. My email address is brain, and I have my account on Mytour.com. I want to send an email to [email protected], and I’m using a standalone email client such as Outlook Express.
When I first set up my account on Mytour, I provided Outlook Express with the name of the mail server — mail.Mytour.com. Now, when I compose a message and hit Send, the following occurs:
- Outlook Express establishes a connection to the SMTP server at mail.Mytour.com via port 25.
- Outlook Express communicates with the SMTP server, providing the sender’s and recipient’s email addresses, as well as the message content.
- The SMTP server separates the recipient’s address ([email protected]) into two components: the user name (jsmith) and the domain name (mindspring.com). If the recipient were another user at Mytour.com, the SMTP server would directly hand the message over to the POP3 server for Mytour (using a utility called the delivery agent). However, since the recipient is with a different domain, the SMTP server needs to contact that domain’s server.
- The SMTP server queries a Domain Name Server (DNS) (see How Web Servers Work for more information). It asks, "Can you provide me with the IP address of the SMTP server for mindspring.com?" The DNS responds with the IP addresses of the SMTP server(s) for Mindspring.
- The Mytour SMTP server then connects to the Mindspring SMTP server via port 25. The interaction mirrors the one between my email client and the SMTP server at Mytour, and the message is passed to the Mindspring server. Recognizing that the domain name for jsmith belongs to Mindspring, it forwards the message to Mindspring’s POP3 server, which places the message in jsmith’s inbox.
If the SMTP server at Mytour fails to connect to the Mindspring SMTP server, the message enters a queue. Most SMTP servers use a program called sendmail to manage this process, and this queue is called the sendmail queue. Sendmail attempts to resend the emails in the queue at intervals, such as every 15 minutes. After about four hours, you may receive a notification of a problem. If the message cannot be delivered within five days, most sendmail configurations will stop trying and return the email as undelivered.
The SMTP server responds to a set of simple text commands such as HELO, MAIL, RCPT, and DATA. Here are some of the most commonly used commands:
- HELO - used to introduce yourself
- EHLO - used to introduce yourself and request extended mode
- MAIL FROM: - used to specify the sender
- RCPT TO: - used to specify the recipient
- DATA - used to define the body of the message (the To, From, and Subject should appear as the first three lines)
- RSET - used to reset the connection
- QUIT - used to end the session
- HELP - used to get help with commands
- VRFY - used to verify an address
- EXPN - used to expand an address
- VERB - used to activate verbose mode
The POP3 and IMAP Servers
In the most basic versions of POP3, the server maintains a series of text files, one for each email account. When a message is received, the POP3 server simply appends it to the end of the recipient’s file.
When you check your email, your email client establishes a connection with the POP3 server via port 110. To log in, the server asks for your account name and password. Once you've logged in, the POP3 server opens your personal text file and grants you access to it. Just like the SMTP server, the POP3 server understands a basic set of text commands. Here are the most common ones:
- USER - enter your username
- PASS - enter your password
- QUIT - end the POP3 session
- LIST - display the messages and their sizes
- RETR - retrieve a specific message by its number
- DELE - delete a message by its number
- TOP - view the top x lines of a message, specify the message number and the number of lines
Your email client connects to the POP3 server and sends a sequence of commands to download copies of your emails to your local machine. Typically, the server will then delete those messages (unless you’ve configured your client not to do so).
As you can see, the POP3 server functions merely as a bridge between your email client and the text file storing your messages. Once again, it’s clear that the POP3 server is a simple system. You can even connect to it via telnet on port 110 and manually issue the commands if you wish (see How Web Servers Work for details on using telnet to connect to servers).
The IMAP Server
As you can see, the POP3 protocol is quite basic. It lets you store your messages in a text file on the server. Your email client (such as Outlook Express) can then connect to the POP3 server and download the messages from that text file onto your computer. That's about the extent of what POP3 allows you to do.
Many users want more functionality than that from their email, and prefer to keep their messages on the server. The main advantage of keeping your email on the server is the ability to access it from various devices. With POP3, once you've downloaded an email, it's tied to the machine where it was downloaded. This makes it challenging if you want to access your emails from both your desktop at the office and your laptop while traveling.
IMAP (Internet Mail Access Protocol) is a more sophisticated protocol that addresses these limitations. With IMAP, your email remains on the server. You can organize your messages into folders, and those folders are stored on the server too. When you search for an email, the search happens on the server, not on your local machine. This setup makes it much easier to access your email from any device, with full access to all your messages and folders no matter which machine you use.
We'll explore the challenges with IMAP and attachments in the next section.
IMAP Problems and Attachments
Your email client connects to the IMAP server via port 143. Once connected, the email client sends a series of text commands that enable it to perform tasks such as listing folders on the server, displaying all message headers in a folder, retrieving a specific email, deleting messages from the server, or even searching through the entire email database on the server.
One issue that arises with IMAP is this simple question: "If all my emails are stored on the server, how can I access them when I'm offline?" To solve this, most email clients offer the option to cache emails locally. For example, the client might download all the messages and store their full contents locally, much like it would with a POP3 server. The emails remain on the IMAP server, but now you have copies on your computer. This lets you read and reply to emails even without an internet connection. The next time you go online, the client will download any new emails and send out the ones you wrote while offline.
Attachments
Your email client enables you to attach files to outgoing emails and also allows you to save attachments from incoming emails. These attachments could be documents, spreadsheets, audio files, images, or even software. Since email messages can only contain text, and attachments are not text, a solution is needed to send and receive non-text content.
In the early days of email, the problem of sending binary files was solved manually with a program called uuencode. This program treated the file as containing binary data. It would take 3 bytes from the binary file, convert them into 4 text characters (by extracting 6 bits at a time, adding 32 to the value of those 6 bits, and generating a text character — see How Bits and Bytes Work for more on ASCII characters). The result was an encoded version of the original file that contained only text characters. Back then, you would manually run uuencode and paste the encoded file into your email message.
Considering its profound influence on communication, it’s amazing how simple today’s email system is! While there are intricate elements, like the routing rules in sendmail, the core structure is remarkably straightforward. So, the next time you send an email, you’ll know precisely how it reaches its destination.
Free and Paid Email Services
People use the Internet for various reasons, whether for work or staying connected with family and friends, and email plays a key role. A Pew Internet and American Life Project study from March 2007 found that 91 percent of U.S. Internet users have accessed the web to send or read emails. Additionally, 56 percent of email users engage with email on a daily basis [source: Email Marketing Reports].
A study conducted in October 2007 by The Radicati Group found that 183 billion emails were sent daily in 2006. With numbers like that, it's easy to see why there is such a wide array of email service providers. These include both free options like Gmail and Yahoo!, as well as paid providers like America Online, Apple, and NetZero.
Gmail and Yahoo! generate revenue through advertising, where advertisers pay to reach email account holders. There are also many online reviews available comparing different free email services. Here are a few descriptions of popular free email services:
- Gmail — Google's free email service, Gmail, provides virtually unlimited online storage. It also includes features for sorting and organizing emails, making it easier to find important messages. Gmail displays contextual ads based on keywords in the emails. The service supports various types of attachments and actively scans for spam, viruses, and worms.
- Yahoo! mail — One of the most well-known free services, Yahoo! offers unlimited storage, text messaging, and RSS news feeds. With over a dozen filters, Yahoo! organizes incoming emails and sends junk mail to a spam folder, allowing users to manage it further. It also includes drag-and-drop tools for easy organization.
- MSN Windows Hotmail — Supported by Microsoft technology, Hotmail is another popular free email service that offers 5 GB of online storage. It features a customizable desktop design, allowing users to choose a layout that suits them. Additionally, Hotmail users can switch between a classic format and an updated version with added features. It also includes Microsoft security features and simple drag-and-drop organization tools for ease of use.
Paid email services often provide additional benefits, such as increased storage capacity. Examples of such providers include Juno, EarthLink, and Webmail.us.
For example, opting for a paid email service makes it easier to set up a personalized address, like using your own name. These services often let you retain the same email address even if you switch ISPs and filter out advertising messages. They also offer additional benefits like dedicated support, custom spam filters, extra email accounts, and mobile access.
Most internet service providers offer email services at no extra cost. There are also paid email options designed for small businesses, providing help with purchasing and managing domain names.
Next, let's go over some essential email etiquette tips for when you're composing and sending your messages.
Email Etiquette
Most people wouldn't dream of being disrespectful or rude when talking to coworkers, clients, or their manager. Yet, these social norms can sometimes slip away when communicating via email.
When it comes to email, the potential for unintended rudeness is high and often hard to spot. While most people avoid using offensive language or insults in professional communication, it's still possible to sound harsh—like when you raise your voice in a conversation. But can you raise your voice in an email?
In this section, we’ll go over some key business writing rules and tips for practicing good email etiquette.
People are busy, so:
- Utilize the subject line. You might be tempted to skip it, but think about how everyone is always in a rush, including the person reading your email. They’ll appreciate the context the subject line gives, making it easier for them to prioritize and organize their inbox.
- Be direct and to the point. Regardless of how witty or entertaining you can be, your recipients will value brevity and clarity. Leave the jokes and clever wordplay for more casual settings like birthday cards. Start with your main message, followed by any clear action the recipient needs to take.
- Keep it between the two of you. Copying others on emails unnecessarily fills up mailboxes and can confuse the primary recipient. Only include others in the loop when there's a specific reason to do so.
- Respond promptly. Don’t let emails linger without a reply. A quick response is appreciated, even if it’s just to let the sender know you need more time to reply fully.
People are sensitive, so:
- Avoid excessive punctuation. Overusing punctuation marks, such as ???? or !!!! at the end of a sentence, can come across as yelling or showing frustration. Stick to regular punctuation norms.
- Don’t use all caps. Writing everything in all caps MAKES IT LOOK LIKE YOU'RE SHOUTING. Shouting is impolite. Follow standard capitalization rules. If you need emphasis, say something like "I want to highlight..."
- Read it aloud before sending. You might think you're conveying exactly what you mean, but reading your email out loud and imagining yourself as the recipient can help catch mistakes before hitting "send." Once it's written, you can’t undo it. Remember, the recipient can easily print or forward it. Never write something you'd regret circulating beyond the immediate recipient.
- Don’t send emails when angry. One of the most common etiquette mistakes is firing off an email in frustration, either towards someone or a situation. As mentioned in "Read it aloud," once you've sent an angry message, it’s hard to take back, and it could haunt you later.
Not everyone is as in-the-know as you, so:
- Limit the use of symbols. Using emoticons like "smiles" can convey mood, but can you be sure the recipient interprets it the same way? A mischievous grin might not be understood the way you intend. To avoid misunderstandings, it's best to skip these symbols altogether.
- Avoid too many abbreviations. Abbreviations like IMHO (in my humble opinion), FWIW (for what it's worth), or ROTFL (rolling on the floor laughing) can confuse or irritate the recipient.
Email should be treated like a formal business letter. Neglecting basic email etiquette may appear disrespectful to the recipient. Don’t let informality damage the recipient’s perception of you.
For more in-depth information on email and related topics, explore the links provided below.
