
92 MAKING THINGS TALK
How Email Works
Transferring mail also uses a client-server model. It
involves four applications: your email program and your
friend’s, and your email server (also called the mail host)
and your friend’s. Your email program adds a header to
your message to say that this is a mail message, who the
message is to and from, and what the subject is. Next, it
contacts your mail server, which then sends the mail on
to your friend’s mail server. When your friend checks her
mail, her mail program connects to her mail server and
downloads any waiting messages. The mail server is online
all the time, waiting for new messages for all of its users.
The transport protocol for mail is called SMTP, the Simple
Mail Transport Protocol. Just like HTTP, it’s text-based, and
you can use it from a command line. When a mail server
delivers a message, it has to figure out which servers are
responsible for handling incoming mail (for example mail.
example.com or smtp.example.com).
If you’d like to find the name of these servers, open
a command window/terminal program, and use the
nslookup command with the -q=mx option (this looks up
the mail server for the domain you specify):
C:\ >nslookup -q=mx gmail.com
Server: Unknown
Address: 192.168.254.1:53
Non-authoritative answer:
gmail.com MX preference = 50, mail exchanger = gsmtp163.google.com
gmail.com MX preference = 50, m