Expect Script Telnet email script

别来无恙 提交于 2019-12-13 10:34:03

问题


Trying to use Expect Script the Active TCL in Windows to send an email out every it is run. Below is the code I have but there is an error message displayed below and would appreciate any help on how to avoid the problem. Thank you.

#!/usr/bin/expect
# \
exec tclsh "$0" ${1+"$@"}
package require Expect

spawn plink -telnet IP PORT
send "ehlo *******.com\r";
send "AUTH LOGIN\r";
expect "334 VXNlcm5hbWU6" sleep .1;
send "*************\r";
sleep .1;
expect "334 UGFzc3dvcmQ6\r"
send "********\r";
sleep .1;
expect "235 Authentication succeeded\r";
send "MAIL from:******@*******.com\r";
expect "250 OK\r"
send "RCPT to:********@*********.com\r";
expect "250 Accepted\r"
send "DATA\r";
send "!

来源:https://stackoverflow.com/questions/14695265/expect-script-telnet-email-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!