使用telnet发送带附件的邮件

[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.


你可能感兴趣的:(使用telnet发送带附件的邮件)