I'm doing some revision on an old app that is written in classic ASP/VbScript.
It has a feature to send out an e-mail to the members of the application, but because the member list is quite large, the server rejects new e-mails after the first hundred or so are sent.
I've written some code to make it send out e-mails in burst of 20, but this still doesn't work. I think that perhaps making it sleep for a second between burst might work properly.
However, I can't seem to find a Thread.Sleep type method in VbScript.
Is there one?
This routine waits any amount of time, and doesn't use CPU:
Function asp_Wait(nMilliseconds)
  Dim oShell
  '' VBS: Set oShell= Wscript.CreateObject("WScript.Shell")
  '' ASP:
  Set oShell= Server.CreateObject("WScript.Shell")
  Call oShell.run("ping 1.1.1.1 -n 1 -w " & nMilliseconds,1,TRUE) 
  '' Option TRUE: Wait until ping is complete
  '' 1000 milli-second wait is 1 second
End Function
                        there is also a good hta hack that should work. Look for the A Synthetic Sleep Function here: http://www.mvps.org/scripting/rube/index.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With