Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
SMTP Fundamentals
3.
SMTP Protocols
4.
Communication between sender and receiver 
4.1.
Sending Mail
4.2.
Receiving Mail
5.
SMTP Commands
6.
Characteristics of SMTP
7.
Advantages of SMTP
8.
Disadvantages of SMTP
9.
Frequently Asked Questions(FAQs)
9.1.
What is HTTP protocol?
9.2.
Which are the protocols used in the Application layer?
9.3.
What is SMTP protocol?
9.4.
List most common network topologies?
10.
Conclusion
Last Updated: Mar 27, 2024

SMTP (Simple Mail Transfer Protocol)

Author Anant Dhakad
0 upvote
Computer Networks

Introduction

This article will discuss the SMTP (Simple Mail Transfer Protocol) in the application layer. Email is gradually establishing itself as one of the most valuable online services. SMTP is the most widely used method for sending email over the internet from one user to another. SMTP is a push protocol used to send emails, whereas POP (post office protocol) or IMAP (internet message access protocol) is used to retrieve emails at the recipient's end.

SMTP Fundamentals

SMTP is a protocol that is used at the application layer. The client who wants to send the email initiates a TCP connection with the SMTP server and then sends the mail over it. The SMTP server has a listening mode that is always active. The SMTP process starts a connection through port 25 as soon as it detects a TCP connection from any client. The client process immediately sends mail after successfully establishing a TCP connection.

SMTP Protocols

There are two types of SMTP models: the end-to-end method and the store-and-forward method. 

The end-to-end method is used for communication between different organizations, whereas the store and forward method is utilized within one organization. In order to transmit the mail to the destination, an SMTP client will contact the destination's host SMTP directly. Until the mail is successfully duplicated to the receiver's SMTP server, the SMTP server will retain it to itself.

Communication between sender and receiver 

Sending Mail

A series of request and response messages are sent between the client and the server to send mail. A header and a body make up the message that is sent across. The mail header is terminated by a null line, and everything after the null line is considered the message body, which is a sequence of ASCII characters. The real information read by the receipt is contained in the message body.

Receiving Mail

On the server side, the user agent checks the mailboxes at specified intervals. If any information is received, the user will be notified. When the user tries to read the email, it displays a list of emails along with a brief explanation of each one. Users can read the contents of any email by choosing it on the terminal.

SMTP Commands

Given are a few examples of SMTP commands.

SMTP Commands

Characteristics of SMTP

  • Port 25 is used by SMTP.
  • It uses persistent TCP connections to send numerous emails at the same time.
  • SMTP is a stateless protocol.
  • SMTP is a connection-oriented protocol.
  • At the transport layer, it uses TCP.

Advantages of SMTP

  • In terms of outgoing email messages, SMTP provides reliability.
  • Email is the most basic method of communication between computers in a network.
  • When a message is not delivered successfully, the SMTP server tries to resend the message until it is delivered properly.

Disadvantages of SMTP

  • SMTP does not offer adequate security.
  • Only 7-bit ASCII characters are allowed.
  • SMTP servers reject email messages that exceed a certain length.
  • The transfer of executable and binary files is not possible with SMTP unless they are transformed into text files.
     

You can also read about mime protocol.

Frequently Asked Questions(FAQs)

What is HTTP protocol?

HTTPS stands for "Hypertext Transfer Protocol Secure." HTTPS is a protocol for communicating securely across a computer network. HTTPS enables websites to be authenticated, preventing unwanted cyberattacks.

When bi-directional communication is used, the HTTPS protocol encrypts the communication to prevent data manipulation. It verifies whether the requested server connection is a genuine connection or not using an SSL certificate. TCP port 443 is used by HTTP.

Which are the protocols used in the Application layer?

Several protocols are used in the Application layer which includes DNS, SMTP, POP, FTP, HTTP etc.

What is SMTP protocol?

Simple Mail Transfer Protocol(SMTP) is an application layer protocol. It is used to send mails.

List most common network topologies?

The most common network topologies are:
1. Mesh topology

2. Bus topology

3. Star topology

4. Ring topology

Conclusion

Cheers if you reached here!! 

In this article, we discussed the SMTP (Simple Mail Transfer Protocol) in the application layer.

Recommended Readings:


Do check out The Interview guide for Product Based Companies as well as some of the Popular Interview Problems from Top companies like Amazon, Adobe, Google, etc. on Coding Ninjas Studio.

Check out some of the amazing Guided Paths on topics such as Data Structure and Algorithms, Competitive Programming, Basics of C, Basics of Java, Computer Networks, etc. along with some Contests and Interview Experiences only on Coding Ninjas Studio

Live masterclass