简单邮件传输协议 (SMTP) 是一种 ASCII 协议。它基于客户端-服务器模型。它为此服务使用 TCP 端口号 25。因此电子邮件;通过 habing 源机器建立一个 TCP 到目标机器的端口 25,将数据从源传送到目的地。要发送邮件,系统必须包含客户端 MTA,而要接收邮件,系统必须具有服务器 MTA。 SMTP 将此消息从客户端 MTA 传输到服务器 MTA。要发送邮件,SMTP 被使用两次:一次在发件人和发件人的邮件服务器之间,另一个在两个邮件服务器之间。
SMTP 命令:
这些命令从客户端发送到服务器。每个命令都包含一个关键字,后跟零个或多个参数。这意味着还有一些关键字不包含任何参数。命令的格式如下:
Keywords : argument(s)
下表给出了14 种不同的 SMTP 命令:
S.No. | Keyword | Command form | Description | Usage |
---|---|---|---|---|
1. | HELO | HELO |
It provides the identification of the sender i.e. the host name. | Mandatory |
2. | MAIL |
It specifies the originator of the mail. | Mandatory | |
3. | RCPT | RCPT |
It specifies the recipient of mail. | Mandatory |
4. | DATA | DATA |
It specifies the beginning of the mail. | Mandatory |
5. | QUIT | QUIT |
It closes the TCP connection. | Mandatory |
6. | RSET | RSET |
It aborts the current mail transaction but the TCP connection remains open. | Highly recommended |
7. | VRFY | VRFY |
It is use to confirm or verify the user name. | Highly recommended |
8. | NOOP | NOOP |
No operation | Highly recommended |
9. | TURN | TURN |
It reverses the role of sender and receiver. | Seldom used |
10. | EXPN | EXPN |
It specifies the mailing lit to be expanded. | Seldom used |
11. | HELP | HELP |
It send some specific documentation to the system. | Seldom used |
12. | SEND | SEND |
It send mail to the terminal. | Seldom used |
13. | SOML | SOML |
It send mail to the terminal if possible; otherwise to mailbox. | Seldom used |
14. | SAML | SAML |
It send mail to the terminal and mailbox. | Seldom used |