Send mail via SMTP; receive mail via POP3

Source: Internet
Author: User


I have just entered a mailbox company and am currently in the training stage. This is my learning task. At the beginning, I followed the training documents, but it was still not clear enough and took some detours. Now, we can record all kinds of details to give a reference to our companions. SMTP sends a mail to connect to the smtp server of 163. Address: smtp.163.com port number: 25 reference www.2cto.com telnet smtp.163.com 25. The following feedback is displayed: 220 163.com Anti-spam GT for Coremail System (163com [20111010]). enter the HELO command and shake hands with the server (note that it is not "HELLO", but "HELO;" is written casually after HELO; HELO). Reference the MTA (Mail Transfer Agent) of the other Party of HELO localhost) the server returns the following information: 250 OK reference pay attention to the previous 250. In SMTP protocol, if the first number of returned information is 200-299, the processing is successful (different numbers have different meanings, the returned number is-499, indicating a temporary failure (that is, you can try again later ). The returned number is-, indicating that the request is rejected (that is, the request will not be received even if you try it later). auth login reference to www.2cto.com auth login requires you to enter the user name, press enter and enter the password. Note that the user name and password are not directly entered. Enter the user name and password for base64 transcoding and then here.
I found a relatively simple transcoding method: Reference perl-MMIME: Base64-e 'print encode_base64 ("test@163.com"); 'After test@163.com transcoding is as follows: dGVzdC5jb20 = Of Course, this perl statement needs to be executed in the environment of the command prompt, that is, the preceding [test @ alpaca ~] $, So it is best to execute it before telnet smtp starts and get the user name and password after transcoding.
If the permission verification is correct, a message indicating 235 Authentication successful mail from: <test@163.com> reference is returned using the "mail from:" command to tell the MTA server that the sender is the test@163.com peer server will return 250 Mail OK. The email Sending address must be the same as the email address used for permission verification. Rcpt to: <123@qq.com> here is the recipient's address. If there are multiple recipients, write multiple rcpt to statements. The recipient's server will return "250 Mail OK" and then use the DATA command to tell the recipient's server that I want to send the email content. The server that references DATA will return 354 End data with <CR> <LF>. <CR> <LF> send mail body www.2cto.com reference FROM: <sweety4572552@163.com> TO: <358245183@qq.com> SUBJECT: HELLOWORLD note, empty line. the end body. The end mark of the email is "Press ENTER +. + press ENTER". At this time, the recipient's server returns 250 Mail OK queued as smtp4, DtGowEA5QXPbtuJP54IgAg --. 1147S2 1340258272, which means the email is successfully sent! Enter quit to exit the clearer text:

Author Su Ye late

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.