Manually use SMTP and POP to send and receive messages WIN7

Source: Internet
Author: User
Tags base64

It's the mail function in PHP that triggers the murders.

I accidentally saw an article with a manual practical SMTP protocol, and then I tried, and a lot of the problems were finally solved.

Now, start.

The SMTP protocol is the routing protocol between the sender and the mail server, and the mail server.

The POP protocol is the delivery protocol that the mail server sends to the receiving party.

We use Telnet to manually manipulate the two protocols.

First we use Telnet to operate the SMTP protocol, we will write the mail to our registered mail server, I am here with 163 smtp.163.com.

My sending address is kefeng-jin@163.com.

I am a WIN7 system, the default is not Telnet service, so you need to be in the "Control Panel" in the program to install this Telnet service, specific online.

At the command line, enter: Telnet smtp.163.com 25//Using port 25th (this color is what we entered)

163.com Anti-Spam GT for Coremail System <163com[20101010]>

Helo smtp.163.com//the equivalent of shaking hands with the server, notifying the server

OK

Auth Login//means to enter the email password account (enter the password after entering the account)

334 Dxnlcm5hbwu6

a2vmzw5nlwppbg==//Can not directly enter plaintext, this is after the Base64 encrypted account

334 Ugfzc3dvcmq6

OTAWNZE0//Encrypted value

235 Authentication Successful

Mail from:<kefeng-jin@163.com>//sender's mailbox, according to your own change

Mail OK

RCPT to:<371385396@qq.com>//Receiver mailbox, you can enter more than one

Mail OK

Data//Data sent after

354 End data with <CR><LF>.<CR><LF>

To:371385396@qq.com//Here the To,from write freely, can deceive

From:dota@163.com

Subject:hello World//title

This is the next blank line entry in the console//header, the message is finished, with a period plus carriage return end

.

Mail OK Queued as Smtp10,wkjadq2apxrnnqbe0cwaew==.38326s3

QUIT//Exit command

Note: Above I began to make time, made a lot of mistakes, when input a command, accidentally input errors, and then press backspace key to modify no or will be wrong, so directly re-enter it.

BASE64 encryption: I may have to send code, now the code has a problem, no time tube, no change, there are two URLs, one thing to introduce this encrypted http://www.5dmail.net/html/2004-1-30/200413084348.htm, The other is to execute the encryption directly.

Http://www.chinaue.com/tool/md5/Base64.htm.

Legacy problem: I use Gmail mailbox has a problem, to be master solution. The internet says it is because of the SSL encryption problem, I have not solved.

POP3 receipt operation, this is relatively simple, I test others. (The user here, the password does not need to encrypt)

[Crazywill@localhost crazywill]$ telnet pop.163.com #telnet登录110端口
Trying 202.108.5.104 ...
Connected to pop.163.com.
Escape character is ' ^] '.
+ok Welcome to Coremail Mail Pop3 Server (163com[20050206))
User Crazywill # Username
+ok Core Mail
Pass MyPassword # login Password
+ok 254 Message (s) [27676669 byte (s)]
STAT # View Mailbox Status
+ok 254 27676669
List # Mailing lists
+ok 254 27676669
1 2468
2 21945
3 33136
4 2071
5 3364
6 18906
7 3136
8 24764
.................

Top 254 0 # View the message headers for the specified message, 0 to view the entire message header, and other positive integers to indicate how many rows the limit returns.
+ok Core Mail
Received:from smtp.63.com (Unknown [58.252.70.158])
by SMTP5 (Coremail) with SMTP ID wkjredra9giffqlejcnrag==.29062s4;
Mon, June 2006 21:07:18 +0800 (CST)
To:crazywill@163.com
From:cccc@163.com # Here is a false sender information forged in front of the letter, normal operation only show this.
Subject:test by TELNET/SMTP # message subject
Message-id: <44A91687.0E6F6C.07562>
Date:mon, 3 June 2006 21:07:19 +0800 (CST)
sender: crazywill@163.com                                              # Here is the real sender, not forged.


.
RETR 254 # Get the specified message
+ok 354 octets
Received:from smtp.63.com (Unknown [58.252.70.158])
by SMTP5 (Coremail) with SMTP ID wkjredra9giffqlejcnrag==.29062s4;
Mon, June 2006 21:07:18 +0800 (CST)
To:crazywill@163.com
From:cccc@163.com
Subject:test by TELNET/SMTP
Message-id: <44A91687.0E6F6C.07562>
Date:mon, 3 June 2006 21:07:19 +0800 (CST)
Sender:crazywill@163.com

Test, just a test.
.

DELE 254 # Delete No. 254 Email
+ok Core Mail
STAT # View Mailbox Status
+ok 253 27676315
QUIT # Exit
+ok Core Mail
Connection closed by foreign host.
[Crazywill@localhost crazywill]$

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.