SMTP
Simple Mail Transport Protocol. It’s a connection oriented text based protocol which works at the application layer of network model that allow message services over TCP connection. It is used for sending messages from a sender to an receiver mail server, in TCP Port 25.
Email Client
It’s a computer program designed to read, organised and send electronic messages.
It use POP, IMAP, SMTP protocols for communication.
POP
Post Office Protocol POP is an internet standard that defines an email server and the way to retrieve mail from it. It is used to download mail from the server. And it can not send emails.
It has 3 versions: POP, POP2 and POP3. POP3 was designed for authentication purposes. It works by storing messages at a POP server, until the user logs in and download messages into their system.
IMAP
Internet Message Access Protocol which is also used to download mails from the server. It is designed to let us keep emails on the server. But it requires more disk space and cpu resources. Works on port 143.
How SMTP works:
Let us assume:
Host ID : me@sender.com
Host email Server: demo.com
Client Id: client@receiver.com
Client email Server: example.com
Step 1) We send an email from an demo.com host server to sender using their mail address, client@receiver.com.
Step 2) Then our e-mail server take senders mail address demo.com and connects to the SMTP sever.
Step 3) Host Mail server will provide the address information of sender’s, receiver’s mail address and content of the message to the SMTP server.
Step 4) SMTP server will take client’s mail id client@receiver.com and divide it into client’s name and the it’s domain name.
Step 5) If the receiver have different domain name, SMTP server will send that email message to the POP3 server and then SMTP will communicate with that domain.
Step 6) SMTP server will then communicate with the DNS server to get to the client’s mail server. DNS server will then provide the IP address of sender address to the SMTP server.
Step 7) SMTP server at the sender side will connect with the SMTP sever of the receiver server.
Step 8) After the connection has made, SMTP server will differentiate the domain name for client at receiver.com and transmit the message to the receiver’s POP3 server and then email will reach to the clients mailbox.
If any trouble occurs between sending senders mail sever and the receiver mail sever, the message goes in sendmail queue. What it does is, it will send mail after some moment of time after troubleshooting the issue. And for some reason it did not works, sendmail queue will return back the message to the sender.