Simple Mail Transfer Protocol (SMTP) is the de facto standard/protocol for email transmission over mutually TCP accessible (sending and receiving) hosts on the Internet as shown in the diagram below, mutually-TCP-accessible hosts on a firewall isolated TCP/IP intranet. SMTP can also transmit email on hosts on a LAN or WAN environment utilizing a non-TCP transport-level protocol. Using SMTP, a process can transfer an email message to another process on the same network or to some other network via a relay or gateway process accessible to both networks (sender/receiver).

SMTP Over The Internet


An email message can be sent to one or many recipients with qualified email addresses. Each email address uniquely identifies the mailbox address of a user on an Internet domain, such as webmaster, username1, username2, etc. on the domain "kayshav.com". The email address format is "username@domain_name". Other domain extensions are listed in reference [3].
Example:  webmaster@kayshav.com

Initially developed in the 1980s, this protocol was designed for email transmission of ASCII text files and later on standards such as MIME were developed to encode and transfer binary files as well. The SMTP uses the TCP port 25. The SMTP works well when both the sending and receiving mail servers are connected to the network all the time. SMTP is independent of the particular transmission subsystem and requires only a reliable ordered data stream chennel. SMTP ensures successful delivery of an email message by the use of commands and numeric codes that are transparent to the sender/receiver. When the destination address is incorrect, the SMTP is designed to send a "undeliverable mail" notification to the sender. The domain name, email address and the SMTP commands are not case sensitive. SMTP is one of the TCP/IP application layer core protocols in the Internet Protocol Suite.
 
In SMTP, a message can travel from source to destination in a single pass or hop through several intermediary relay or gateway hosts on its route from sender to the ultimate recipient. The Mail eXchanger mechanisms of the DNS will identify the order of hops for the message, in its route to the destination

SMTP Commands
DATA - DATA
EHLO - Extended HELLO
EXPN - EXPAND
HELO - HELLO
HELP - HELP
MAIL - MAIL
NOOP - NOOP
QUIT - QUIT
RCPT - RECIPIENT
RSET - RESET
VRFY - VERIFY
 

SMTP Reply Codes By Function Groups (listed by code number)
211 System status, or system help reply
214 Help message
220 <domain> Service ready
221 <domain> Service closing transmission channel
250 Requested mail action okay, completed
251 User not local; will forward to <forward-path>
354 Start mail input; end with <CRLF>.<CRLF>
421 <domain> Service not available, closing transmission channel
450 Requested mail action not taken: mailbox unavailable (busy)
451 Requested action aborted: error in processing
452 Requested action not taken: insufficient system storage
500 Syntax error, command unrecognized
501 Syntax error in parameters or arguments
502 Command not implemented
503 Bad sequence of commands
504 Command parameter not implemented
521 Host does not accept mail
550 Requested action not taken: mailbox unavailable
551 User not local; please try <forward-path>
552 Requested mail action aborted: exceeded storage allocation
553 Requested action not taken: mailbox name not allowed (mailbox syntax incorrect)
554 Transaction failed
556 Domain does not accept mail


Many applications, database engines, IoT, cloud services, etc. have integrated SMTP (Oracle) to enable emails from processes to automate internal workflow. They are also used in error handling and warning. Email has become the way to communicate reservations, billing/payment confirmation and in social media for communication.


Reference information and links:
1. J. Klensin, Simple Mail Transfer Protocol, RFC-2821, AT&T Laboratories, April 2001..
2. Jonathan B. Postel, Simple Mail Transfer Protocol, RFC-821, USC/Information Sciences Institute, August 1982.
3. Generic Top Level Domain Extensions gTLD
4. Latest SMTP updates (521 and 556 Reply Codes), RFC-7504, June 2015.



  Last Revised On: May 31st, 2022