telnet smtp.qq.com 25 // Resonse : 220 smtp.qq.com Esmtp QQ Mail Server
helo sis //Resonse :250 smtp.qq.com
auth login //Resonse :334 VXNlcm5hbWU6
<pre name="code" class="html">****** //Resonse :334 UGFzc3dvcmQ6 (发送邮件的账号,base64编码)
****** //Resonse :235 Authentication successful (发送邮件的账号密码,base64编码)
mail from: <******@qq.com> //Resonse : 250 Ok
rcpt to: <1****@qq.com> //Resonse : 250 Ok
data //Resonse : 354 End data with <CR><LF>.<CR><LF>
to: hello //发件人名称 ,此项可任意填入,将显示在收件箱的'发件人'一栏
from: nian //收件人名称 ,可任意填入,将显示在收件箱的'收件人'一栏
subject: this is a test telnet smtp mail
Content-Type: multipart/mixed; boundary="a" //内容类型,边界="a",相当于把邮件划分成几个模块,以--a为分界(a可以随便命名)
--a
This is the preamble. It is to be ignored, though it is a handy place for composition agents to include an explanatory note to non-MIME conformant readers. //邮件正文
--a
Content-Type: application/octet-stream;name="test.txt" //内容类型是应用,即附件;附件名reed.txt
Content-Transfer-Encoding: base64 //附件内容的编码方式
6ZmE5Lu25rWL6K+V //附件测试
--a-- //data结束
. //邮件全部内容结束
quit //与服务器断开
使用telnet发送邮件
最新推荐文章于 2021-12-27 18:16:51 发布