Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

vb sender script delay?

vb sender script delay?

vb sender script delay?

Option Explicit

Dim A2, A1, s, f1, ts, ts1, fso, fso1, Soobshenie, SiteAddr1, SiteAddr2, bs, cur_time, api_key, api_secret, Message, HTTPgetCrypted
Const ForReading = 1
Const ForWriting = 2


Sub Die()

End Sub

Sub Main

'NEXMO Credentials
api_key = ""
api_secret = ""

Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile("nexmonumbers.txt", ForReading)
SiteAddr1 = "https://rest.nexmo.com/sms/json?api_key="&api_key&"&api_secret="&api_secret&"&from=12012857494&to="
SiteAddr2 = "&type=unicode&text="
Message = "sms text"

Do While Not ts.AtEndOfStream
s = ts.ReadLine
HTTPgetCrypted = SiteAddr1 & s & SiteAddr2 & Message
A1 = ""
A1 = HTTPGetSend(HTTPGetCrypted)
cur_time = time & " --- " & date
Set fso1 = CreateObject("Scripting.FileSystemObject")
Set ts1 = fso1.OpenTextFile("nexmoresult.txt", 8, True)
Set fso1 = Nothing
Set ts1 = Nothing
MsgBox "SMS sending complete, please see nexmoresult.txt for log"
End Sub

Function HTTPGetSend(ByVal URLGet)
Set oHTTP = CreateObject("MSXML2.XMLHTTP")
oHTTP.Open "GET",URLGet,False
HTTPGetSend = oHTTP.responseText
Set oHTTP = Nothing
End Function

Hello guys,i have this nexmo sms sender, how i can write this code for a delay between sms's ! Nexmo api support 1 sms per second but this script run to fast :)) . Exemple : put the numbers and start the script ,send first sms pause one second ,send 2nd sms pause another second..

RE: vb sender script delay?

Have a look at Vbscript's Sleep function

RE: vb sender script delay?

that's i try to find :))) if someone can help me with pause

RE: vb sender script delay?

Do you mean like have it dormant for a certain amount of time?

Bob Space

RE: vb sender script delay?

Assuming your default scriptining engine is wscript, which appears to be the case, rather than cscript, Something like

CODE -->

WScript.Sleep 1000 

or, for both cscript or wscript, a (bad practice) tight loop

CODE -->

Do Until Now > DateAdd("s",1, start)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close