How does email work?
Source:@alexxu / https://blog.bytebytego.com/
Last updated
Source:@alexxu / https://blog.bytebytego.com/
Last updated
Alice logs in to her Outlook client, composes an email, and presses “send.” The email is sent to the Outlook mail server. The communication protocol between the Outlook client and the mail server is SMTP.
The outlook mail server queries the DNS (not shown in the diagram) to find the address of the recipient’s SMTP server. In this case, it is Gmail’s SMTP server. Next, it transfers the email to the Gmail mail server. The communication protocol between the mail servers is SMTP.
The Gmail server stores the email and makes it available to Bob, the recipient.
The Gmail client fetches new emails through the IMAP/POP server when Bob logs in to Gmail.
If you are unfamiliar with email protocols, here is a short summary:
SMTP: Simple Mail Transfer Protocol (SMTP) is the standard protocol for sending emails from one mail server to another.
The most popular protocols for retrieving emails are the Post Office Protocol (POP) and the Internet Mail Access Protocol (IMAP).
POP is a standard mail protocol to receive and download emails from a remote mail server to a local email client. Once emails are downloaded to your computer or phone, they are deleted from the email server, which means you can only access emails on one computer or phone.
The details of POP are covered in RFC 1939. POP requires mail clients to download the entire email. This can take a long time if an email contains a large attachment.
IMAP is also a standard mail protocol for receiving emails from a local client. When you read an email, you are connected to an external mail server, and data is transferred to your local device.
IMAP only downloads a message when you click it, and emails are not deleted from mail servers, meaning that you can access emails from multiple devices. IMAP is the most widely used protocol for individual email accounts.