问题
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