All messages will travel through many points on it's way.
I will generalize, because each server is very specific. These points are
1. Your PC. When you use mail client like Outlook or Thunderbird we usually call this computer "mail client" This is the start point. When you press "Send" button, that is what happens.
2. Mail server you connect to. When you send a message, it travels through 2-3 (depending on a situation) email servers. (They are sometimes called mail servers or email servers, whatever you prefer, we will not get stuck on the names, but just so you know).
3. Database with all the messages. This is where your message will end up after you send it and it is delivered. This is similar to a database of all messages that are waiting for a particular user. In your case, your message will wait for your recipient to read it. Keep in mind, that messages are never sent directly to your recipient's computer. Your target recipient will check from time to time if there are messages in his mailbox.
4. Your receiver's workstation. This is where your message is going to end up. This is where your recipient will read it.
Let me demonstrate with an example.
This is Jane, she wants to tell John how she liked her date with him and she wants to thank him and invite him to dinner in a romantic restaurant. She is inquiring about what does he prefer, French or Italian. ..
Sorry, got distracted. I am still talking about email servers.
OK, let's concentrate.
She writes the letter and hits "Send" button and naturally, this message goes to her server. Every user has one, even if you use a free Gmail account or Yahoo or you have Outlook installed, I don't care, you will always, always send your message to SMTP server.
This mail server is a big piece of software... Usually even more than one big piece :) It quickly checks your message headers, looks at the destination (among everything else) and tries to find the server, where John's mailbox is located.
Now, here is that other SMTP server. In some easy case, when both John's and Jane's emails are located on the same domain, like if John's email is john@gmail.com and Jane's email is jane@gmail.com, there is no need to search and of course, there will be no need to contact another SMTP server.
We call it "local delivery". Similar to when you want to send a letter to a guy, who lives in the same building as you. Just drop it in his mailbox. No need for stamp or postman. See, nothing to it.
Now, in a more complex case, where John's email is located elsewhere on another computer, we will need to find out where exactly.
We will ask a DNS (Domain Name Server) for the IP address, which is the exact location of John's server.
DNS has a huge database of all network addresses and their IP numbers and it will quickly search through those and give us an answer.
We know, that in our example John's email is not on gmail.com.
Let's say his email is: john@yahoo.
SMTP server will take away john@ and will be left with yahoo.
It runs an MX (Mail eXchange) search in the DNS database. It spits out IP address or addresses of where yahoo.com really is (it can have more than one IP for one name, especially for big providers. Similar to rich boys having many apartments in different cities, but we won't get into that). I just mention that to scare you, that's all).
Wow. .. Hard part's over... I hope.
Now we are almost at the end phase. We know the destination address, all we have to do is deliver this message to this destination.
We connect to other mail server, and place Jane's message into the loving care of John's mail server (this is simplified of course, but it is similar to what happens, I just skipped a few steps).
But that is not the end, now John's server will check if this message is spam, cause. .. you never know and this stage is so complex, I will not even scare you, you will see just a general overview of this process later and I will probably have a separate video explaining what are the most typical anti spam filters are and how they work.
It's important to know if you want to send a lot of email for your email marketing, but if you are here just out of curiosity, you don't need it.
I will just briefly say this: "Most of mail server's processing power goes to determine if a message is spam". There are dedicated computers running for that on many providers.
Delivering a message is relatively easy, but spam checks are very complex.
At this point we are past the spam filter and Jane's message is safely stored in John's mailbox (or should I say in his mail mail store database).
It is waiting for John to connect to his server and get his message over to his client, so John can read a lovely letter from Jane, so they can finally pick the restaurant they both love.
So when this name comes up: "SMTP", what do we mean by that? Why is it called SMTP? Is this an acronym?
This is just a short version of Simple Mail Transfer Protocol. ..
Simple??? Not to me. ..
Perhaps whoever named it, had another, more complex protocol in mind? Well, not really, that's the only one we have.
When it was defined back in 1982 by a special committee of total brainiacs, they thought it was simple. ..
But you have to keep in mind, that these guys did not have any instant messenger at that time. They used to actually deliver mail by hand. You know, one where it actually involves a postman.
This is a text protocol (well most of Internet protocols are). Back in the day, the brainiacs thought that text is all we will ever need to deliver, so the protocol is all text. So these days, to deliver pictures and files and videos other brainiacs created extensions to that protocol that work around the work around that was created to work around sending text.
Yeeeah, right, OK. Back to the subject.
This protocol is a standard for every single email server on the planet, so all email in the world is delivered this way.
Of course, it means that everyone creating an SMTP server, must adhere to the rules.
Of course this excludes Microsoft, because they have "special" engineers and they know much better how their mail server should work.
They are so smart they don't need any protocols, they can just go without them So they partially support SMTP protocol.
It's not stable enough. In many places in their SMTP servers they do something against the protocol and I have seen it many times. Just because they are Microsoft and there are a gazillion people using their product, they just ignore it.
But besides Microsoft everybody else uses it
Spam checks, very high level overview.
We suspect any message that comes into our mail server and we examine it even before the message comes in we look at the connection it comes from.
Email server examines your IP to see if you are from a "bad neighborhood". There are lots of databases that check and update a list of "bad IP addresses" and if your IP will be there, your connection will be rejected before you will even have a chance to start the conversation.
It is similar to "we do not open the door to strangers" thing.
After you are past that check, server will verify that the headers you send are correct.
It may check that a domain from which you claim to send your message exists and that it is registered to send email for this IP.
Then it may also check that the return address from your IP corresponds back to the host name you claim to be from.
Of course it will check your message itself. This is what takes the most time. Many trained AI algorithms are developed for this step.
It will find any "stop" words like make a million dollars, won a lottery, making money fast and so on. Most of these words can be found in any spam message.
About 80%-90% of all of the messages in the world are spam! So much garbage is flying around the glob created by a few people.
Just a few idiots create that heavy load on all of the servers, which we pay for. Reminds me of the government... Hehe. We pay the fees to our ISP.
ISP invest it into heavier infrastructure and lots of filters, just to be able to accept and then immediately throw away 90% of all emails.