Prayer

在一般中寻求卓越
posts - 1256, comments - 190, trackbacks - 0, articles - 0
  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

使用telnet发送带附件的邮件

Posted on 2011-12-13 14:21 Prayer 阅读(1684) 评论(0)  编辑 收藏 引用 所属分类: SOCKET

[root@localhost ~]# telnet smtp.126.com 25
Trying 202.108.5.141...
Connected to smtp.126.com (202.108.5.141).
Escape character is '^]'.
220 126.com Anti-spam GT for Coremail System (126com[071018])
ehlo ###@126.com //###代表你的126邮箱用户名
250-mail
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250 8BITMIME
auth login
334 dXNlcm5hbWU6
###                     //###代表你的126邮箱用户名的base64编码
334 UGFzc3dvcmQ6
###                    //###代表你的126邮箱密码的base64编码
235 Authentication successful
mail from:<###@126.com> //###@126.com代表你的126邮箱地址
250 Mail OK
rcpt to:<###@mail.psychcn.com> //###@mail.psychcn.com
250 Mail OK
data
354 End data with <CR><LF>.<CR><LF>
subject: How to use telnet to send mail
Content-Type: multipart/mixed; boundary=a
--a
Content-Disposition: attachment; filename="1.txt"   //附件
--a
.
250 Mail OK queued as smtp4,jdKowLB7CjgufrJIgl6YIA==.63330S2 1219657375
quit
221 Bye
Connection closed by foreign host.



只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理