MMS via Command line VBscript

MMS via Command line VBscript SearchSearch
Author Message
GSM TEST
Posted on Thursday, November 06, 2008 - 06:20 am:   

Has anyone been able to successfully configure this script to send to multiple recipients? I was able to configure it for a single recipient, but if I attempt to add more the error “Invalid Phone Number” is displayed.
I tried many different combinations in the command line script and even played around with the vbscript with no success. Any ideas?

Previous post URL with the vbscript
http://blog.nowsms.com/2007/07/sending-mms-from-command-line.html
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 212
Registered: 08-2008
Posted on Thursday, November 06, 2008 - 12:58 pm:   

The function isValidPhoneNumber doesn't seem to like the "," character.

I've probably overcomplicated it with the edit below, but this edit allows a "," and allows a "+" at the start of the phone number or after a ",".


quote:


'function to test if the phone number is a valid format
Function isValidPhoneNumber(theStr)

LenString = Len(theStr)
isValid = True

for i = 1 to LenString
midStr = Mid(theStr, i, 1)
if (i > 1) Then
prevChar = Mid(theStr, i-1, 1)
End if
if (midStr = "+") AND ((i = 1) OR (prevChar =",")) Then
elseif (midStr = "0") OR (midStr = "1") OR (midStr = "2") OR (midStr = "3") OR (midStr = "4") OR (midStr = "5") OR (midStr = "6") OR (midStr = "7") OR (midStr = "8") OR (midStr = "9") OR (midStr = ",") Then
else
isValid = False
End if
Next
isValidPhoneNumber = isValid

End Function


GSM TEST
New member
Username: Gsmtest

Post Number: 2
Registered: 04-2006
Posted on Thursday, November 06, 2008 - 06:52 pm:   

Thank you very much for the quick response! It works great!