以163邮箱为例:
http://blog.yx127.com/index.php?action=show&id=190
参考了est'blog上的一篇文章
http://202.115.22.199/Blog/electronixtar/archive/2006/11/15/11617.aspx
--------------------------------------------------------------------------------
→→→→→→→telnet收邮件
注意:所有响应+OK (ok) or -ERR (no)
1.连接→telnet pop.163.com 110
2.用户名→user ****
3.密码→pass ****
4.验证ok后,终端会显示如下信息:
+OK 60 message(s)
数字60表示有60封邮件,72208371表示这60封邮件总的字节数(即72208371B)
这时可使用的命令如下:
1.stat命令 格式:stat 无需参数
stat命令,查看统计,执行后,POP3服务器会响应一个正确应答,它以“+OK”开头,接着是两个数字,第一个是邮件数目,第二个是邮件的大小
2.list命令 格式:list 参数n可选,n为邮件编号
list命令,查看邮件列表,可以利用不带参数的list命令,获得各邮件的编号,并且每一封邮件均占用一行显示,前面的数为邮件的编号,后面的数为邮件的大小
3.uidl命令 格式:uidl 参数n可选,n为邮件编号
uidl命令,与list同,不过显示邮件的信息比list更详细,更具体
4.retr命令 格式:retr n 参数n不可省,n为邮件编号
retr命令,查看邮件的内容
5.dele命令 格式:dele n 参数n不可省,n为邮件编号
dele命令,删除指定的邮件(注意:dele n命令只是给邮件做上删除标记,只有在执行quit命令之后,邮件才会真正删除)
6.top 命令 格式:top n m 参数n,m不可省,n为邮件编号,m为行数
top命令,读取指定邮件正文的行数,如果m=0,则只读出邮件的邮件头部分
7.noop命令 格式:noop 无需参数
noop命令,该命令发出后,POP3服务器不作任何事,仅返回一个正确响应"+OK"
8.quit命令 格式:quit 无需参数
quit命令,该命令发出后,telnet断开与POP3服务器的连接,系统进入更新状态
--------------------------------------------------------------------------------
→→→→→→→telnet发邮件
1.连接→telnet smtp.163.com 25
回显"220"
2.报名字(随便写)→helo vkill
回显"250 ok"
3.登陆模式(这时选一般登陆模式)→AUTH LOGIN
回显"334 dXNlcm5hbWU6"
(注:这时的用户和密码都为Base64编码后的字符,手头没有Base64编码加密器的话,偶提供个在线的:
http://www.yx127.com/base64.html)
4.用户名→****
回显"334 UGFzc3dvcmQ6"
5.密码→****
回显"235 Authentication successful" 表示验证通过
6.发件人→mail from: <
he200377@163.com>
回显"250 Mail OK"
7.收件人→rcpt to: <
he200377@56.com>
回显"250 Mail OK"
8.开始写正文→data
输入正文内容就ok,正文要符合MIME规范
例子:
From:
he200377@163.com ←电子邮件的发信人
To:
he200377@56.com ←电子邮件的收信人
Cc:
he200377@56.com ←接收通过抄送方式发送的邮件的收件人
Subject: test ←电子邮件的主题
MIME-Version: 1.0 ←MIME 协议的版本
Content-Type: text/plain ←邮件格式text
hello vkill ←内容
当行输入. 回车,回显"250 OK"发送成功
9.断开连接→quit
Take 163 mailbox as an example:
http://blog.yx127.com/index.php?action=show&id=190
Referenced an article on est'blog
http://202.115.22.199/Blog/electronixtar/archive/2006/11/15/11617.aspx
--------------------------------------------------------------------------------
→→→→→→→Telnet to receive emails
Note: All responses are +OK (ok) or -ERR (no)
1. Connect → telnet pop.163.com 110
2. Username → user ****
3. Password → pass ****
4. After successful verification, the terminal will display the following information:
+OK 60 message(s)
The number 60 indicates there are 60 emails, and 72208371 indicates the total number of bytes of these 60 emails (that is, 72208371B)
The commands that can be used at this time are as follows:
1. stat command Format: stat No parameters required
stat command, view statistics. After execution, the POP3 server will respond with a correct answer, which starts with "+OK", followed by two numbers. The first is the number of emails, and the second is the size of the emails
2. list command Format: list Parameter n is optional, n is the email number
list command, view the email list. You can use the list command without parameters to obtain the number of each email, and each email is displayed in one line. The number in front is the email number, and the number behind is the size
3. uidl command Format: uidl Parameter n is optional, n is the email number
uidl command, same as list, but the information displayed about the email is more detailed and specific than list
4. retr command Format: retr n Parameter n is not optional, n is the email number
retr command, view the content of the email
5. dele command Format: dele n Parameter n is not optional, n is the email number
dele command, delete the specified email (Note: The dele n command only marks the email for deletion. The email will not be truly deleted until the quit command is executed)
6. top command Format: top n m Parameter n, m are not optional, n is the email number, m is the number of lines
top command, read the number of lines of the body of the specified email. If m = 0, only the email header part is read out
7. noop command Format: noop No parameters required
noop command, after this command is sent, the POP3 server does nothing and only returns a correct response "+OK"
8. quit command Format: quit No parameters required
quit command, after this command is sent, the telnet disconnects from the POP3 server, and the system enters the update state
--------------------------------------------------------------------------------
→→→→→→→Telnet to send emails
1. Connect → telnet smtp.163.com 25
Echo "220"
2. Report name (write randomly) → helo vkill
Echo "250 ok"
3. Login mode (at this time, select the general login mode) → AUTH LOGIN
Echo "334 dXNlcm5hbWU6"
(Note: The user and password here are both characters encoded in Base64. If you don't have a Base64 encoding encryptor at hand, I provide an online one:
http://www.yx127.com/base64.html)
4. Username → ****
Echo "334 UGFzc3dvcmQ6"
5. Password → ****
Echo "235 Authentication successful" indicates successful verification
6. Sender → mail from: <
he200377@163.com>
Echo "250 Mail OK"
7. Recipient → rcpt to: <
he200377@56.com>
Echo "250 Mail OK"
8. Start writing the body → data
Just enter the body content, and the body should comply with the MIME specification
Example:
From:
he200377@163.com ← Sender of the email
To:
he200377@56.com ← Recipient of the email
Cc:
he200377@56.com ← Recipient of the email that receives the email sent by cc
Subject: test ← Subject of the email
MIME-Version: 1.0 ← Version of the MIME protocol
Content-Type: text/plain ← Email format text
hello vkill ← Content
When the line enters. Press Enter, echo "250 OK" sent successfully
9. Disconnect → quit