The receiving server uses an email client to download incoming mail via Internet Message Access Protocol (IMAP), for example, and places it in the recipient's inbox. The recipient can then access and view the messages on demand.
When a user clicks the send button in their email client, a Transmission Control Protocol (TCP) connection is established that links to an SMTP server -- or a connection between the email server and the email client.
To establish the connection and start the email sending process, the SMTP client sends a predefined text-based command called HELO to the SMTP server. When it receives the TCP connection from a client, the SMTP process starts a connection through a port, usually port 25, to send the email. From here, the client tells the server what to do by providing information such as the sender's and recipient's email addresses and the email's content. It also informs the server when transmission of data is complete, at which point the server closes the connection.
A mail transfer agent (MTA), which is a specialized program run by the server, then checks whether both email addresses are from the same email domain.
This server might or might not be the email's destination. If it is, the recipient then uses IMAP or Post Office Protocol 3 (POP3) to receive the email. But if it's not, the SMTP connection process repeats between multiple email servers until the email reaches a server controlled by the recipient's email provider. At this point, it reaches the recipient's inbox.