How email works
When looking at how email works, there are two major components to consider – clients and servers. The client allows the end user to read and compose email messages, while the server handles the sending and receiving of messages on the network.
You’ve probably already received several email messages today. To look at them, you use some sort of email client. Many people use well-known stand-alone clients - applications like Microsoft Outlook, Eudora, or Pegasus. People who subscribe to free email services like Hotmail or Gmail are likely to use a web-based email client that appears in a browser. If you are an AOL customer, you use AOL's email reader. No matter which type of client you are using, it generally does four things:
- It shows you a list of all the messages in your mailbox by displaying the message headers. The header shows you who sent the mail, the subject of the mail, and may also show the time and date of the message and the message size.
- It lets you select a message header and read the body of the email message.
- It lets you create new messages and send them. You type in the email address of the recipient and the subject of the message, and then type the body of the message.
- Most email clients also let you add attachments to messages you send and save the attachments from messages you receive.
Sophisticated email clients may have all sorts of bells and whistles, but at its core, this is all that an email client does.
Image: How email works
For the majority of users, the real e-mail system consists of two different servers running on a 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 either a POP3 server or an IMAP server, both of which handle incoming mail. POP stands for Post Office Protocol, and IMAP stands for Internet Mail Access Protocol.
When the client calls the email server to send or check for mail, it connects to the server on certain TCP/IP ports:
The SMTP server listens on port 25, POP3 listens on port 110 and IMAP uses port 143.
Let's assume that you want to send a piece of email. Your email ID is brian, and you have an account on blueemailserver.com. You want to send email to email@example.com, and you're using a stand-alone e-mail client, like Outlook.
When you set up an account at blueemailserver, you told Outlook the name of the mail server, mail.blueemailserver.com. When you compose a message and press the Send button, here is what happens:
- Outlook connects to the SMTP server at mail.blueemailserver.com.com using port 25.
- Outlook has a conversation with the SMTP server, telling the SMTP server the address of the sender and the address of the recipient, as well as the body of the message.
The SMTP server takes the ‘to’ address (firstname.lastname@example.org) and breaks it into two parts:
- The recipient’s name (jsmith)
- The domain name (redemailserver.com)
If the ‘to’ address had been another user at blueemailserver.com.com, the SMTP server would simply hand the message to the POP3 server for blueemailserver.com (using a little program called the delivery agent). Since the recipient is at another domain, SMTP needs to communicate with that domain.
The SMTP server has a conversation with a Domain Name Server, or DNS. It says, ‘Can you give me the IP address of the SMTP server for redemailserver.com?’ The DNS replies with the one or more IP addresses for the SMTP server(s) that redemailserver operates.
The SMTP server at blueemailserver.com connects with the SMTP server at redemailserver using port 25. It has the same simple text conversation that your e-mail client had with the SMTP server for blueemailserver and gives the message to the redemailserver server. The redemailserver server recognises that the domain name for jsmith is at redemailserver, so it hands the message to redemailserver's POP3 server, which puts the message in jsmith's mailbox.
In this Course, you’ll further explore the web protocols that underpin the internet and the world wide web, and some of the applications they enable.
A world-leading tech and digital skills organization, we help many of the world’s leading companies to build their tech and digital capabilities via our range of world-class training courses, reskilling bootcamps, work-based learning programs, and apprenticeships. We also create bespoke solutions, blending elements to meet specific client needs.