Introduction to SMTP commands and ESMTP sending Process

Source: Internet
Author: User

Introduction to SMTP commands and ESMTP Processes

What is SMTP

SMTP (Simple Mail Transfer Protocol): the transmission protocol used to transmit an email from a client to a server or from one server to another. SMTP is a request/response protocol. commands and responses are based on ASCII text and end with Cr and LF characters. The response includes a three-digit number indicating the returned status.Code. SMTP listens for connection requests on TCP port 25.

What is ESMTP?

ESMTP (Extended SMTP), as its name implies, is an extension of the standard SMTP protocol. It differs from the SMTP service in that the user account does not need to be verified when sending mail via SMTP. When sending mail via ESMTP, the server requires the user to provide the user name and password for authentication. The email sending process after verification is no different from the SMTP method.

SMTP command

SMTP commands include:

Helo identifies the user to the server. The sender can cheat and lie, but generally the server can detect it.

EHLO identifies the user to the server. The sender can cheat and lie, but generally the server can detect it.

The address specified in the mail from command is the sender address.

Rcpt to identifies a single email recipient; multiple rcpt to can be used; it is often behind the MAIL command.

After one or more RCPT commands, data indicates that all Email recipients have been identified, and data transmission is initialized, ending with CRLF. CRLF.

VRFY is used to verify whether the specified user or email address exists. This command is often disabled by the server for security reasons.

EXPN verifies whether the specified mailbox list exists and expands the mailbox list.

Help query commands supported by the server

No Noop operation, the server should respond OK

Rset resets the session and the current transmission is canceled.

Quit end session

========================================================== ======================================

In XP, an email is sent to QQ through the SMTP command on the 163 server. I tested it, and in turn, it is true.
The following is an email sent from 163 to QQ,

IP: IP address resolved by 220.181.12.14 // smtp.163.com
Port: 25
Begin connect... ------------------------------------------------- connecting to port 25 of the server
Connected ----------------------------------- port 25 of the server is successfully connected.
220 163.com anti-spam GT for coremail System (163com [20081010])

Helo smtp.163.com --------------------------------- identify the user to the server, do not authenticate the mail, skip the following steps to directly send the mail from command
250 OK ------------------------------------------------ ESMTP command, the mail must be authenticated.

Auth login ------------------------------------------------- perform user Identity Authentication
334 dxnlcm5hbwu6

User: XXXXXXXX ----------------------------------- base64 encrypted user name
334 xxxxxxxxxxxx ---------------------------------------- the user name exists.

Passxxxxxxxxxxxxx = ------------------------------------- base64 encrypted password (Note: The password must be followed by a "=" character, otherwise an error may occur)
235 authentication successful ---------------------------------------- authentication successful

(535 auth failure -------------------------------------------- failed to authenticate)

 

Mail from: <chhuic@163.com> ------------------------------ mail from address chhuic@163.com (Note: must contain <>, otherwise a 500 syntax error occurs)
250 mail OK --------------------------------------------------------- Command Execution successful

Rcpt to: <418715961@qq.com> -------------------------------- deliver to address 418715961@qq.com (Note: must contain <>, otherwise 500 syntax error occurs)
250 mail OK --------------------------------------------------------- Command Execution successful

Data --------------------------------------------------------- data transmission Initialization
354 end data with <CR> <LF>. <CR> <LF> ----------------------------------------------- start Data Transmission

From: chhuic@163.com
To: 418715961@qq.com
Date: 0001-1-1 0:00:00
Subject: Subject

Body Text
.
------------------------------------------------------------ Data content, including base64 encrypted mail content, ends data transmission with CRLF. CRLF
250 mail OK ----------------------- Command Execution successful

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.