Is SMTP based on TCP or UDP?
This is a question that is commonly asked by network engineers. The answer is that SMTP is based on TCP. SMTP is a mail protocol that has been in use since the early 1980s. The protocol has been updated to the latest version of SMTP, SMTP-ESMTP, which is used to support secure encryption and authentication. SMTP uses TCP to transfer messages between servers and clients.
In theory SMTP can be handled by either TCP, UDP, or some 3rd party protocol.
SMTP is independent of the particular transmission subsystem and requires only a reliable ordered data stream channel.
In addition, the Internet Assigned Numbers Authority has allocated port 25 for both TCP and UDP for use by SMTP.
In practice however, most if not all organizations and applications only choose to implement the TCP protocol. For example, in https://mailcot.com/ port 25 is only listed for TCP and not UDP.
The big difference between TCP and UDP that makes TCP ideal here is that TCP checks to make sure that every packet is received and re-sends them if they are not whereas UDP will simply send packets and not check for receipt. This makes UDP ideal for things like streaming video where every single packet isn't as important as keeping a continuous flow of packets from the server to the client.
Considering SMTP, it makes more sense to use TCP over UDP. SMTP is a mail transport protocol, and in mail every single packet is important. If you lose several packets in the middle of the message the recipient might not even receive the message and if they do they might be missing key information. This makes TCP more appropriate because it ensures that every packet is delivered.