使用expect自动发送邮件的脚本
时间:2006-01-06 来源:dominic_80
#!/usr//bin/expect
spawn telnet mail.domain.com 25
expect "220"
send "ehlo mail.domain.com " expect "HELP"
send "auth login " expect "334"
send "邮件用户名(base64编码) " expect "334"
send "密码(base64编码) " expect "235"
send "mail from:[email protected] " expect "250"
send "rcpt to:[email protected] " expect "250"
send "data From: [email protected] To: jack@domain.com Date: Subject: test mail HI,test dominic's test . " expect "250"
send "quit "
spawn telnet mail.domain.com 25
expect "220"
send "ehlo mail.domain.com " expect "HELP"
send "auth login " expect "334"
send "邮件用户名(base64编码) " expect "334"
send "密码(base64编码) " expect "235"
send "mail from:[email protected] " expect "250"
send "rcpt to:[email protected] " expect "250"
send "data From: [email protected] To: jack@domain.com Date: Subject: test mail HI,test dominic's test . " expect "250"
send "quit "
相关阅读 更多 +