SMTP Protocol

The smtp protocol(Simple Mail Transfer Protocol) is the standard internet protocol technology used by people all around the world for sending e-mail over Internet Protocol. Electronic mail(e-mail) uses many computers on the way from sender to receiver. It depends on the sender and the receiver which computers the e-mail travels through, but the port of call is always the smtp server. It is a must to communicate with this server, otherwise the e-mail cannot be transferred to the receiver. Even though as technology advanced better technologies have evolved for transferring e-mail, but still smtp continues to be the norm.

SMTP Protocol

SMTP is defined for sending mails and it uses Transmission Control Protocol(TCP) port number 25, for receiving electronic mail user applications normally use Post Office Protocol(POP) or Internet Message Access Protocol(IMAP) to access their mail server. The smtp protocol is a push protocol, that is it can only push electronic mail messages to mail servers. It is a text based protocol, which uses command strings in 7-bit ASCII to transfer necessary data using TCP.

This is how the smtp protocol works:
The Mail User Agent(MUA) submits an e-mail to a mail server, that is the Mail Submission Agent(MSA) using the port 25 of the TCP. The Mail Transfer Agent transfers the mail to the transfer agent, that is the Mail Transfer Agent(MTA). If the processing is done on a single computer the data can be shared by processes, if processing is done through various computers, then smtp is used to transfer data locally. The last MTA has to locate the destination host through Domain Name System(DNS). The DNS is used to locate the Mail Exchanger record (MX Record) of the recipient’s server, that is the target host. MTA then gets the IP address of the host and connect to it as a smtp client. When the message is accepted it is handed over to the Mail Delivery Agent(MDA) for delivery. The Mail Delivery Agent saves it in the recipients mailbox on the target server, as the recipient can download the message from any computer. The mail is downloaded using the Post Office ProtocolPOP) or the Internet Message Access Protocol(IMAP), or any other as there is no standard protocol for mail retrieval. The Mail can be downloaded form a single or many computers so if downloaded from many computers a derivative of the smtp protocol is used, the Local Mail Transfer Protocol(LMTP).

SMTP Protocol – Conclusion


SMTP session is always initiated by the smtp client (sender) and the smtp server communicates correspondingly. The session may include as many transactions as necessary, each transaction consists of three command sequences:
1.MAIL command to establish return address,
2.RCPT command to establish recipient address,
3.DATA command for the data of the message.

Here is an example for initiation of the smtp protocol:

C: HELO relay.example.org
S: 250 Hello relay.example.org, I am glad to meet you
C: MAIL FROM:
S: 250 Ok
C: RCPT TO:
S: 250 Ok
C: RCPT TO: S: 250 Ok
C: DATA
S: 354 End data with .

The smtp protocol server always closes the connection.


Like this post? Subscribe to my RSS feed and get loads more!