How Email Works: SMTP, MX Records, IMAP and Email Authentication

By Michael Goldsmith · Updated September 23, 2026

Illustration for the guide to how email works

Sending an email feels instant and simple, but a message passes through several separate systems, each with its own job, before it reaches the recipient. This guide follows one message from Alice to Bob and explains each piece along the way: the address, DNS and MX records, SMTP, the mailbox protocols IMAP and POP3, and the authentication checks (SPF, DKIM and DMARC) that decide whether a message is trusted.

The parts of an email address

In alice@example.com, the part before the @ is the local part: it names a mailbox. The part after the @ is the domain: it tells the internet which organisation's mail servers are responsible for that mailbox. Mail servers route messages using only the domain. What happens to the local part is entirely up to the receiving domain, which is why some providers ignore dots in the local part, and why tricks like plus addressing work (see our comparison of aliases).

Step 1: Alice's app hands the message to her provider

Alice writes her message in an email app or webmail. When she clicks Send, the app submits it to her own provider's outgoing server. This first hop uses SMTP, the Simple Mail Transfer Protocol, on the submission port 587 (or 465 with encryption from the start). Alice's app must log in first, which stops strangers using her provider to send mail.

Behind the scenes, every message has two parts: the envelope (who the servers should deliver it to, and where bounces should go) and the content, which includes headers such as From, To, Subject and Date, followed by the body. The From line people see is part of the content and, on its own, proves nothing. That gap is what email authentication (below) exists to close.

Step 2: finding Bob's mail server with DNS

Bob's address is bob@example.org. Alice's server needs to know which machine accepts mail for example.org, so it asks the Domain Name System for the domain's MX (mail exchanger) records. A typical answer looks like this:

example.org. 3600 IN MX 10 mx1.example.org. example.org. 3600 IN MX 20 mx2.example.org.

The numbers are priorities: lower is tried first. If mx1 is unreachable, the sender falls back to mx2. The 3600 is how many seconds other servers may cache the answer. If a domain has no MX record at all, senders fall back to the domain's ordinary address record.

Step 3: server-to-server delivery over SMTP

Alice's server connects to Bob's mail exchanger on port 25 and the two servers hold a short, plain-text conversation. Stripped down, it looks like this:

S: 220 mx1.example.org ESMTP ready C: EHLO mail.example.com S: 250-mx1.example.org 250-STARTTLS C: STARTTLS (the rest is now encrypted) C: MAIL FROM:<alice@example.com> S: 250 OK C: RCPT TO:<bob@example.org> S: 250 OK C: DATA S: 354 Send message C: (headers and body) . S: 250 Queued as 4F7A2C

STARTTLS upgrades the connection to encryption when both sides support it, which today is the case for almost all large providers. If Bob's server is temporarily down, Alice's server keeps the message in a queue and retries for several days before giving up and sending Alice a bounce message.

Step 4: checks on arrival

Before accepting the message into Bob's mailbox, his provider runs checks. Three DNS-based standards do most of the work of spotting forged senders:

SPF (Sender Policy Framework)

The sending domain publishes a list of servers allowed to send its mail, as a TXT record such as v=spf1 include:_spf.example.com -all. The receiver checks whether the connecting server is on that list for the envelope sender's domain.

DKIM (DomainKeys Identified Mail)

The sending server signs parts of the message with a private key. The receiver fetches the matching public key from the sender's DNS and verifies the signature. A valid DKIM signature proves the message really passed through a server authorised by that domain and was not altered on the way.

DMARC (Domain-based Message Authentication, Reporting and Conformance)

SPF and DKIM each check a domain, but not necessarily the one in the visible From line. DMARC ties them to it: a message passes DMARC only if SPF or DKIM passes and the domain that passed matches the From address. The domain owner also publishes a policy saying what receivers should do with failures: nothing (p=none), send them to spam (p=quarantine) or refuse them (p=reject).

Since 2024, Google and Yahoo require bulk senders to their users to have SPF, DKIM and a DMARC record in place. That has made spoofing big brands much harder, which is why modern phishing more often uses lookalike domains instead. Our phishing guide shows what those look like.

Providers then add their own spam filtering on top, looking at the sender's reputation, the content and the links.

Step 5: Bob reads his mail with IMAP or POP3

Once stored, the message waits in Bob's mailbox until his app collects it. Two protocols do that job:

IMAPPOP3
Where mail livesOn the server; apps show a synchronised viewDownloaded to one device, usually removed from the server
Several devicesYes, folders and read status stay in syncPoorly; each device sees a different copy
Encrypted port993995
Best forAlmost everyone todayA single computer with limited server storage

Webmail such as Gmail or Outlook.com skips these protocols for its own website and apps, but still offers IMAP so that other email programs can connect.

Where temporary email fits in

A temporary email service is a normal receiving domain with an unusual rule: it accepts mail for any local part and forgets it quickly. Steps 1 to 4 happen exactly as above; step 5 is replaced by a web page that shows the message for a few minutes. Our guide to how a temporary address works walks through that process for EmailVanish specifically.

Key terms