您的位置:首页 > 理论基础 > 计算机网络

《http权威指南》读书笔记 五

2015-05-06 13:01 162 查看
系统环境cengos6.2,需要装expect
脚本如下:
#!/usr/bin/expect
set smtp smtp.qq.com
set user ******* #**代表QQ号吗经过base64加密过的值
set pass ******* #**代表密码经过base64加密过的值
set from 986870231@qq.com
set to 986870231@qq.com
set title think
set content fuck
spawn telnet $smtp 25
expect "220"
send "helo root\r"
expect "250"
send "auth login\r"
expect "334"
send "$user\r"
expect "334"
send "$pass\r"
expect "235"
send "MAIL FROM: <$from>\r"
expect "250"
send "RCPT TO: <$to>\r"
expect "250"
send "DATA\r"
expect "354"
send "TO: $to\r"
send "FROM: $from\r"
send "SUBJECT: $title\r"
send "\r"
send "$content\r"
send ".\r"
expect "250"
send "QUIT"

本文出自 “B0UNDLESS” 博客,请务必保留此出处http://b0undless.blog.51cto.com/7409864/1264152
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: