17.3. Example: A Client to Verify E-Mail Addresses

One of the best ways to get comfortable with a network protocol is to open a telnet connection to the port a server is on and try out commands interactively. For example, consider connecting directly to a mail server to verify the correctness of potential e-mail addresses. To connect to the mail server, we need to know that SMTP (Simple Mail Transfer Protocol) servers generally listen on port 25, send one or more lines of data after receiving a connection, accept commands of the form expn username to expand usernames, and accept quit as the command to terminate the connection. Commands are case insensitive. For instance, Listing 17.5 shows an interaction with the mail server at apl.jhu.edu.

Get Core Web Programming, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.