How to send and receive messages under command Line (Dos) _ Common Tools

Source: Internet
Author: User
Tags base64 server port
Today, see the online introduction said to use the command line to send and receive mail, so specifically write the process.
To receive mail:
Open the Run dialog box on the Start menu, and enter command telnet and the remote server port number, such as:
Telnet Pop3.163.com 110 will establish a connection with the POP3 server pop3.163.com "NetEase 163 free Mail".
If the connection above is successful, the POP3 server responds to the following information (displayed on the terminal):
+ok Welcome to Coremail Mail Pop3 Server (163com[20050206))
User GREENERYCN If the username is logged on successfully, the POP3 server responds to the following information:
+ok Core Mail
Enter password pass password If successful, the terminal will display the following information:
+ok 5 Message (2267 octets)
The number 5 indicates 5 messages, and 2267 indicates the total number of bytes (that is, 2267B) of the 5 messages.
The following commands can then be used, and their command format and parameters are described as follows:
1.stat command format: stat without parameters
2.list command format: list [n] parameter n optional, n for message number
3.UIDL command format: uidl [n] Ditto
4.RETR command format: retr n parameter n not province, N for message number
5.dele command format: Dele N ditto
6.top command format: Top N m parameter n,m not province, N for message number, m for line number
7.noop command format: noop without parameters
8.quit command format: quit without parameters
Detailed features of each command are shown in the following instructions:
1, stat command without parameters, for this command, the POP3 server will respond to a correct answer, this response is a single line of information prompts, it begins with "+ok", followed by two numbers, the first is the number of messages, the second is the size of the message, such as: +ok 4 1603
2, the list command parameters are optional, the parameter is a number, which represents the number of messages in the mailbox, we can use the list command without parameters to get the number of each message, and each message occupies one line, the previous number is the number of the message, the number of the following is the size of the message.
3, uidl command and List command is similar to the use, but UIDL command display message information than the list more detailed, more specific, the implementation of the results as shown in Figure four.
4, the RETR command is the most important order to receive mail, its role is to view the content of the message, it must take the parameters, the command after the implementation of the server to answer the information is relatively long, including the sender's e-mail address, the time of the mail, the subject of the message, which is collectively referred to as the message header, The message immediately after the message header is the text
5, the DELE command is used to delete the specified message (Note: Dele n command only to do the deletion of the message tag, only after the execution of the QUIT command, the message will be really deleted), the deletion of the answer message as shown in Figure six.
6, the top command has two parameters, such as: Top N m n for the message number, M is to read the number of lines of the message body, if m=0, then read only the message head points
7, NoOp command, the command issued after the POP3 server does nothing, only return a correct response to "+ok"
8, quit command, the command issued, Telnet disconnect with the POP3 server, the system into the updated state.
But looking at Google's email in this way is encoded and cannot be seen in Chinese.
DOS Letter
1. base64 code to compute username and password: http://lishiditu.008.net/base64.html
[Telnet smtp.163.com 25//Login smtp.163.com port number is 25
163.com Anti-Spam GT for Coremail System (163com[20050206])
HELO localhost//greet the server and inform the client of the name of the machine used, you can fill it out casually
OK
AUTH Login//Use identity Authentication login command
334 Dxnlcm5hbwu6
YWJJ//Enter the username that has been base64_encode ().
334 UGFZC3DVCM
mtizndu2//Enter a password that has been Base64_encode ()
235 Authentication Successful
MAIL from:<greenerycn@163.com>//Tell the address of the sender of the server
Mail OK
RCPT to:<yourframe@21cn.com>//Tell the server the address of the addressee
Mail OK
The DATA//front begins to transmit the contents of the letter, and finally to be contained only. End of the special line.
354 End data with <CR><LF>.<CR><LF>
To:yourframe@21cn.com
From:redsos3@163.com
Subject:test Mail
test,# the contents of the message body, and start writing with the header part blank line
Test body
. # After the message is written, add the return result with a period.
Mail OK Queued as Smtp14,f0cpbfsuzuovodwe.41582s2
QUIT//Disconnect
221 Bye
Connection closed by foreign host.
Status Code Description:
220: Service Ready
250: The Request mail action is correct, completes (helo,mail from,rcpt to,quit instruction execution Success will return this information)
235: Certification through
221: Being processed
354: Start sending data, end with. (This information is returned by a successful execution of the data command)
500: syntax error, command not recognized
550: The command cannot be executed, the mailbox is invalid
552: Interrupt Processing: The user exceeds the file space

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.