How emails work?

          . E-mail is the exchange of messages through internet.
          . It uses different protocols to send and receive messages from its server:

  What is SMTP?

          . To send and receive mails, we need Mail Transfer Agent and Mail Access Agent.
          . Simple Mail Transfer Protocol is a Mail Transfer Agent (MTA).
          . There are two MTAs: Client MTA and Server MTA.
          . Client MTA at client's system sends mail to the Server MTA at client mail server.
          . Now Client MTA at client's mail server forwards this mail to the Server MTA of receiver's mail server.
          . Sender and receiver must be connected to their mail server through WAN or LAN.
          . SMTP is used in two steps - In between sender and its mail server and in between client's mail server and receiver's mail server.

      What is POP?

             . Post Office Protocol is a Mail Access Agent (MAA).
             . POP3 is a 3rd version of POP.
             . It is used to pull the mail from server MTA and handle it to receiver.
             . There are two MAAs: Client MAA and Server MAA.
             . Client MAA is installed in the receiver's computer and Server MAA is present in the Mail server.
             . To read or access mail from server, Client MAA establishes connection with server MAA.
             . When user logs in, Client MAA at receiver sends username and password to the mail server.
             . Using POP, whenever we access a mail, it gets downloaded in the local computer where we opened and it gets disappeared in the mailserver.
             . We couldn't open that mail in other devices which is a major disadvantage.
             . So we use Internet Mail Access Protocol (IMAP) which stores mails in the mailbox and we can open them in any devices.

       SMTP Vs POP3:

Simple Mail Transfer ProtocolPost Office Protocol version3
Mail Transfer AgentMail Access Agent
Applied between sender and sender's mail server and sender's mail server to receiver's mail serverApplied between receiver and receiver's mail server
Allows to send mail from sender to mail box in receiver's mail serverAllows to retreive mail from receiver's mail server to receiver's computer
Uses port 25 in TCP for transmissionUses port 110 in TCP for transmisson