HELO (Hello)The client sends this command to the SMTP server to identify itself and initiate the SMTP conversation. The domain name or IP address of the SMTP client is usually sent as an argument together with the command (e.g. “HELO client.example.com”). If a domain name is used as an argument with the HELO command, it must be a fully qualified domain name (also called FQDN).
MAIL FROMSpecifies the e-mail address of the sender. This command also tells the SMTP server that a new mail transaction is starting and makes the server to reset all its state tables and buffers etc. This command is usually sent as the first command after the identifying and login process. If the senders e-mail address is accepted the server will reply with a 250 OK reply code. Example:
C: MAIL FROM:<mail@samlogic.com> S: 250 OK |
C: MAIL FROM:<mail@samlogic.com> S: 250 OK C: RCPT TO:<john@mail.com> S: 250 OK C: RCPT TO:<peggy@mail.com> S: 250 OK |
DATAThe DATA command starts the transfer of the message contents (body text, attachments etc). After that the DATA command has been sent to the server from the client, the server will respond with a 354 reply code. After that, the message contents can be transferred to the server. When all message contents have been sent, a single dot (“.”) must be sent in a line by itself. If the message is accepted for delivery, the SMTP server will response with a 250 reply code. Example (the message contents is set to italic in the example below):
C: DATA S: 354 Send message content; end with <CRLF>.<CRLF> C: Date: Thu, 21 May 2008 05:33:29 -0700 C: From: SamLogic <mail@samlogic.com> C: Subject: The Next Meeting C: To: john@mail.com C: C: Hi John, C: The next meeting will be on Friday. C: /Anna. C: . S: 250 OK |
沒有留言:
張貼留言