日期:2014-05-16 浏览次数:20758 次
#!/usr/bin/expect -f spawn telnet smtp.xxx.com 25 expect "])" send "helo 163\r" expect "250 OK" send "auth login\r" expect "334*" send "用户名base64编码后\r" #if you don't how to get your base64 encode,reference note 1 on the bottom. expect "334*" send "密码base64编码后\r" expect "235*" send "mail from:<xxxxxxxx@163.com>\r" expect "250*" send "rcpt to:<xxxxxx@qq.com>\r" expect "250*" send "data\r" expect "354*" send "from:xxxxxxx@163.com\r" send "to:xxxxxxx@qq.com\r" send "subject:server error\r" send "MIME-Version:1.0\r" send "content-type:text/plain\r" send "服务器挂掉了\r" send ".\r" expect "250*" send "quit\r"