j***@cyberpine.com
2003-12-07 00:47:35 UTC
Hello. I have this console WSH vbscript that can send an email alert
given some arguments. The script works, but does not cleanly exit
telnet. The last message I see is 'press any key to continue'. I can't
seem to send anything programatically to satify the request and so
that I can the quit Telnet.
Below is my code. Any help or information is grealy appreciated!
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.Run "Telnet"
WSHShell.AppActivate "Telnet"
WScript.Sleep 1000
WSHShell.SendKeys "open mail.somesmtpserver.net 25~"
WScript.Sleep 1000
WSHShell.SendKeys "helo~"
WScript.Sleep 1000
WSHShell.SendKeys "mail from: ***@hotmail.com"
WScript.Sleep 500
WSHShell.SendKeys "rcpt to: ***@yahoo.com~"
WScript.Sleep 500
WSHShell.SendKeys "data~"
WScript.Sleep 500
WSHShell.SendKeys "Subject: item#123456~"
WScript.Sleep 500
WSHShell.SendKeys "description~"
WScript.Sleep 500
WSHShell.SendKeys "price~"
WScript.Sleep 500
WSHShell.SendKeys "line2~"
WScript.Sleep 500
WSHShell.SendKeys ".~"
WScript.Sleep 2000
WSHShell.SendKeys "~"
WScript.Sleep 500
WSHShell.SendKeys "quit~"
===
last thing i see in the console window:
Connection to host lost.
Press any key to continue...
===
it's almost as if WSH can talk at this level.
given some arguments. The script works, but does not cleanly exit
telnet. The last message I see is 'press any key to continue'. I can't
seem to send anything programatically to satify the request and so
that I can the quit Telnet.
Below is my code. Any help or information is grealy appreciated!
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.Run "Telnet"
WSHShell.AppActivate "Telnet"
WScript.Sleep 1000
WSHShell.SendKeys "open mail.somesmtpserver.net 25~"
WScript.Sleep 1000
WSHShell.SendKeys "helo~"
WScript.Sleep 1000
WSHShell.SendKeys "mail from: ***@hotmail.com"
WScript.Sleep 500
WSHShell.SendKeys "rcpt to: ***@yahoo.com~"
WScript.Sleep 500
WSHShell.SendKeys "data~"
WScript.Sleep 500
WSHShell.SendKeys "Subject: item#123456~"
WScript.Sleep 500
WSHShell.SendKeys "description~"
WScript.Sleep 500
WSHShell.SendKeys "price~"
WScript.Sleep 500
WSHShell.SendKeys "line2~"
WScript.Sleep 500
WSHShell.SendKeys ".~"
WScript.Sleep 2000
WSHShell.SendKeys "~"
WScript.Sleep 500
WSHShell.SendKeys "quit~"
===
last thing i see in the console window:
Connection to host lost.
Press any key to continue...
===
it's almost as if WSH can talk at this level.