How E-Mail Works

I want to know how the E-Mail works and how your E-Mail Server fits in?
This question gets asked a lot in one form or another. Some people who are getting into the field of e-mailing know some basic stuff, but want to have a deeper understanding of the subject.
Here is a short explanation that will help you understand much better what happens, when you press that send button on your favorite mail client.

Please, take a look at the diagram below. It outlines basic steps involved in sending an email message.

Here are the steps explained in more details:
  • Step 1:You typed your message on your favorite mail client such as Outlook Express, Outlook, The Bat!, Thunderbird and so on. You then press send and the sending process begins. Typically, in the modern communications world, you always have your SMTP server. This could be your Internet Service Provider's (ISP) SMTP server, or you have received details from your boss on how to use your corporate SMTP server. After you press send on your mail client, it starts an SMTP protocol session with your SMTP server as you see in the picture above. All Internet protocols must adhere to certain standards created and maintained by special designated bodies of experts. They create and update documents they call RFC's. All email clients must follow these standards so that different servers can communicate to each other properly. Here is a standard that is used in SMTP protocol. In short, SMTP session is an exchange of text commands and reply codes between a client and a server or between two servers. Here is how a typical SMTP protocol exchange looks like:

    After SMTP server accepts your message for delivery, it will typically store it in it's local queue and then proceed to step 2.
  • Step 2:After your SMTP Server has accepted your message for delivery and stored it in it's local queue, it will check, which hosts they need to contact, in order to deliver a message. So, how does it find exactly where to go in this case? Using a DNS (Domain Name Service), it will query a record of each recipient. For example, if you are sending to and, SMTP server will need to first find domains and then send your message to a user on this domain called user1. Then it will find and connect to domain and send a message to user2 on that domain.
    Mail has a special record type used by DNS, called MX (Mail Exchange). It may contain multiple servers (if host has more than one SMTP server registered) and good SMTP server try each one of them until one of them is successful. Here is how this record looks for domain

    After all addresses are found, your SMTP server starts another SMTP session with each IP address that it received and going through them one by one, until one of them accepts your message. The session is exactly the same as you saw in step 1 above. And now we come to step 3.
  • Step 3:Most, if not all providers have some sort of security and spam filtering in place. Most modern SMTP servers have various spam fighting and security features enabled. For example our E-Mail Server includes a lot of security, authentication and spam filtering in place.
    Almost all modern servers will check your IP address, message content, headers format, adherence to Internet standards and so on. Filters range in complexity, from very simple ones, to super-complex Bayesian logic filters that are self teaching by content as you go. After your message has been filtered and (hopefully) passed all the content checks, we go to step 4
  • Step 4:Now, the step 4 really happens only when remote user connects to the server to look at his email. Your ISP is holding all your messages for you in his queue until you pick them up, transfer them to your computer and delete them from the server. That is why you see a lot of providers using the words like quota and disk space for your mailbox. They must hold all your unread messages for you until you actually connect and pick them up. Their server must be 24/7 operational to receive them and for you to pick them up.
    To look at your messages, there are multiple various ways. The most popular protocol by far is POP3, where you simply read the content of the message to your mail client and then delete it on the server freeing up space for more messages. That is what most email server support including our E-Mail Server