Hi Guys,
I have a small VB script that I'd like to use for sending out a test mail;
I'd like the script to close automatically when done sending,
At the moment it gives "Press any key to continue" at the end of the script and does not close the session window.
The script is as follows;
Option explicit
Dim oShell
set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "telnet"
WScript.Sleep 1000
oShell.Sendkeys "open mail.server.co.za 25~"
WScript.Sleep 1000
oShell.Sendkeys "helo server.co.za~"
WScript.Sleep 1000
oShell.Sendkeys "mail from: sender@server.co.za~"
WScript.Sleep 1000
oShell.Sendkeys "rcpt to: recipient@server.co.za~"
WScript.Sleep 1000
oShell.Sendkeys "data~"
WScript.Sleep 1000
oShell.Sendkeys "Subject:Test Procedure Confirmation~"
WScript.Sleep 1000
oShell.Sendkeys "~"
WScript.Sleep 1000
oShell.Sendkeys "~"
WScript.Sleep 1000
oShell.Sendkeys "This is a confirmation of the Test procedure~"
WScript.Sleep 1000
oShell.Sendkeys ".~"
WScript.Sleep 1000
oShell.Sendkeys "quit~"
WScript.Sleep 1000
Wscript.Quit
* I've tried adding another QUIT to the end of the script, but doesn't help.
Our community of experts have been thoroughly vetted for their expertise and industry experience.