How Email Works

An e-mail message is a simple piece of text sent to a recipient. E-mail messages tend to be text, although the ability to add attachments has become increasingly important. To look at e-mail messages, you use an e-mail client. Many people use well-known, stand-alone clients, such as Microsoft Outlook, Outlook Express, Eudora, or Pegasus.
By Marshall Brain July 15, 2002

An e-mail message is a simple piece of text sent to a recipient. E-mail messages tend to be text, although the ability to add attachments has become increasingly important.

To look at e-mail messages, you use an e-mail client. Many people use well-known, stand-alone clients, such as Microsoft Outlook, Outlook Express, Eudora, or Pegasus. People who subscribe to free e-mail services like Hotmail or Yahoo use an e-mail client that appears in a web page. If you are an AOL customer, you use AOL’s e-mail reader. Regardless of the client you are using, it generally does four things:

  • It shows you a list of all of the messages in your mailbox by displaying the message headers. The header shows you who sent the mail, the subject of the mail, and in some programs the time and date of the message and the message size.

  • It lets you select a message header and read the body of the e-mail message.

  • It lets you create new messages and send them. You type the e-mail address of the recipient and the subject for the message, then type the body of the message.

  • Most e-mail clients also let you add attachments to messages you send and save the attachments from messages you receive.

    • Machines on the internet can run software applications that act as servers. There are web, FTP, telnet, and e-mail servers running on millions of machines on the internet. These applications run all the time on a server. They listen to specific ports, waiting for people or programs to attach to the port. The simplest possible e-mail server would do the following:

    • Maintain a list of e-mail accounts, with one account for each person who can receive e-mail on the server.

    • Create a text file for each account in the list.

    • If someone wanted to send a message, the person would compose a text message in an e-mail client, and indicate to whom the message should go. When the person clicks the “send” button, the e-mail client would connect to the e-mail server and pass to the server the name of the recipient, the name of the sender, and the body of the message.

    • The server would format those pieces of information and append them to the bottom of the recipient’s file.

      • As other people send mail to the recipient, the server would simply append those messages to the bottom of the file in the order that they arrived. The text file would accumulate a series of messages. Eventually the recipient would log in to read them. When the recipient wanted to look at his or her e-mail, the e-mail client would connect to the server machine. In the simplest possible system, it would:

      • Ask the server to send a copy of the recipient’s text file.

      • Ask the server to erase and reset the recipient’s text file.

      • Save the recipient’s text file on his or her local machine.

      • Parse the file into the separate messages using the word “From:” as the separator.

      • Show the recipient all of the message headers in a list.

        • When the recipient double-clicks on a message header, the client will find that message in the text file and display the body of the e-mail.

          The e-mail system consists of two different servers running on a single server machine. One is called the SMTP Server, where SMTP stands for simple mail transfer protocol. The SMTP server handles outgoing mail. The other is a POP3 Server, where POP stands for post office protocol. The POP3 server handles incoming mail. Whenever you send a piece of e-mail, your e-mail client interacts with the SMTP server to handle the sending. The SMTP server on your host may have conversations with other SMTP servers to actually deliver the e-mail.

          To send an e-mail using a stand-alone e-mail client, such as Outlook Express, the user sending the e-mail must already have an e-mail account. When the user composes a message and clicks the “send” button, Outlook Express connects to the SMTP server at the user’s domain. Outlook Express has a conversation with the SMTP server, telling it the address of the sender and the address of the recipient, as well as the body of the message.

          Your e-mail client allows you to add attachments to e-mail messages you send, and also lets you save attachments from messages that you receive. Attachments might include word processing documents, spreadsheets, sound files, snapshots, and pieces of software.