Open In App

Simple Mail Transfer Protocol (SMTP)

Improve
Improve
Like Article
Like
Save
Share
Report

Email is emerging as one of the most valuable services on the internet today. Most internet systems use SMTP as a method to transfer mail from one user to another. SMTP is a push protocol and is used to send the mail whereas POP (post office protocol) or IMAP (internet message access protocol) is used to retrieve those emails at the receiver’s side. 

What is Simple Mail Transfer Protocol?

SMTP is an application layer protocol. The client who wants to send the mail opens a TCP connection to the SMTP server and then sends the mail across the connection. The SMTP server is an always-on listening mode. As soon as it listens for a TCP connection from any client, the SMTP process initiates a connection through port 25. After successfully establishing a TCP connection the client process sends the mail instantly. 

Simple Mail Transfer Protocol

SMTP

SMTP Protocol

The SMTP model is of two types:

  • End-to-End Method
  • Store-and-Forward Method

The end-to-end model is used to communicate between different organizations whereas the store and forward method is used within an organization. An SMTP client who wants to send the mail will contact the destination’s host SMTP directly, to send the mail to the destination. The SMTP server will keep the mail to itself until it is successfully copied to the receiver’s SMTP. 
The client SMTP is the one that initiates the session so let us call it the client-SMTP and the server SMTP is the one that responds to the session request so let us call it receiver-SMTP. The client-SMTP will start the session and the receiver SMTP will respond to the request. 

Model of SMTP System 

In the SMTP model user deals with the user agent (UA), for example, Microsoft Outlook, Netscape, Mozilla, etc. To exchange the mail using TCP, MTA is used. The user sending the mail doesn’t have to deal with MTA as it is the responsibility of the system admin to set up a local MTA. The MTA maintains a small queue of mail so that it can schedule repeat delivery of mail in case the receiver is not available. The MTA delivers the mail to the mailboxes and the information can later be downloaded by the user agents.

SMTP Model

SMTP Model

Components of SMTP

  • Mail User Agent (MUA): It is a computer application that helps you in sending and retrieving mail. It is responsible for creating email messages for transfer to the mail transfer agent(MTA).
  • Mail Submission Agent (MSA): It is a computer program that receives mail from a Mail User Agent(MUA) and interacts with the Mail Transfer Agent(MTA) for the transfer of the mail.
  • Mail Transfer Agent (MTA): It is software that has the work to transfer mail from one system to another with the help of SMTP.
  • Mail Delivery Agent (MDA): A mail Delivery agent or Local Delivery Agent is basically a system that helps in the delivery of mail to the local system. 

Working of SMTP

Below mentioned are the steps of the working of SMTP [Simple Mail Transfer Protocol].

  • Communication between the sender and the receiver: The sender’s user agent prepares the message and sends it to the MTA. The MTA’s responsibility is to transfer the mail across the network to the receiver’s MTA. To send mail, a system must have a client MTA, and to receive mail, a system must have a server MTA. 
  • Sending Emails: Mail is sent by a series of request and response messages between the client and the server. The message which is sent across consists of a header and a body. A null line is used to terminate the mail header and everything after the null line is considered the body of the message, which is a sequence of ASCII characters. The message body contains the actual information read by the receipt. 
  • Receiving Emails: The user agent on the server-side checks the mailboxes at a particular time of intervals. If any information is received, it informs the user about the mail. When the user tries to read the mail it displays a list of emails with a short description of each mail in the mailbox. By selecting any of the mail users can view its contents on the terminal.
Working of SMTP

Working of SMTP

Some SMTP Commands

  • HELO: Identifies the client to the server, fully qualified domain name, only sent once per session
  • MAIL: Initiate a message transfer, the fully qualified domain of the originator
  • RCPT: Follows MAIL, identifies an addressee, typically the fully qualified name of the addressee, and for multiple addressees use one RCPT for each addressee
  • DATA: Send data line by line

For more, you can refer to SMTP Commands.

Difference Between SMTP and Extended SMTP

Extended STMP is an extended version of SMTP. Extended SMTP is a set of protocols for sending and receiving electronic messages on the internet. First, Email is sent from sender to sender-server through ESTMP and from sender-server to receiver-server on the internet through ESTMP. ESMTP follows the same protocols as SMTP. It adds more functionality, security, and authentication than SMTP. 

Let’s see some basic differences between them.

SMTP Extended SMTP
Users were not verified in SMTP as a result of massive-scale scam emails being sent. In Extended SMTP, authentication of the sender is done.                                   
We cannot attach a Multimedia file in SMTP directly without the help of MMIE. We can directly attach Multimedia FIle in ESMTP.
We cannot reduce the size of the email in SMTP. We can reduce the size of the email in Extended SMTP.
SMTP clients open transmission with the command HELO. The main identification feature for ESMTP clients is to open a transmission with the command EHLO (Extended HELLO).

Advantages of SMTP

  • If necessary, the users can have a dedicated server.
  • It allows for bulk mailing.
  • Low cost and wide coverage area.
  • Offer choices for email tracking.
  • Reliable and prompt email delivery.

Disadvantages of SMTP

  • SMTP’s common port can be blocked by several firewalls.
  • SMTP security is a bigger problem.
  • Its simplicity restricts how useful it can be.
  • Just 7-bit ASCII characters can be used.
  • If a message is longer than a certain length, SMTP servers may reject the entire message.
  • Delivering your message will typically involve additional back-and-forth processing between servers, which will delay sending and raise the likelihood that it won’t be sent.

Frequently Asked Questions on SMTP – FAQs

What is the default port for SMTP?

The default port for Simple mail Transfer Protocol is port 25.

What is SMTP Relay?

SMTP Relay can be basically defined as the process of transferring emails from one server to another server.

Describe some common issues in SMTP Email Delivery.

Some common issues that appeared in SMTP Email Delivery is Blocked Ports, Authrntication Problem, etc.



Last Updated : 26 Feb, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads