Runtime Error 424

abbaddon223

Registered User.
Local time
Today, 07:21
Joined
Mar 13, 2010
Messages
162
Hi,

I'm hoping someone might be able to help me please?

I'm trying to use an API to send an SMS. I've already got the SMS supplier etc etc - but when I run the code, I get a "Object Required" - "Runtime Error 424" at the following line:

Set oXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")

I'm sure it's either a reference that need to be on, or I need to download something to do with Document Object Model - but I'm at a loss now :banghead:

Any help would be really appreciated - and thanks for any help in advance.


Dim sUrl
Dim sAPI_ID, sPassword, sUsername, sMobileNo, sText
Dim oXMLHTTP, sPostData, sResult
sUrl = "http://api.clickatell.com/http/sendmsg"
sAPI_ID = "MyID"
sPassword = "MyPassword"
sUsername = "MyUsername"
sMobileNo = "TheNumber"
sText = "This is an example message"
sPostData = "api_id=" & sAPI_ID
sPostData = sPostData & "&user=" & sUsername
sPostData = sPostData & "&password=" & sPassword
sPostData = sPostData & "&to=" & sMobileNo
sPostData = sPostData & "&text=" & sText
Set oXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
oXMLHTTP.Open "POST", sUrl, False
oXMLHTTP.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oXMLHTTP.Send sPostData
sResult = oXMLHTTP.responseText
Set oXMLHTTP = Nothing
Response.Write sResult
 

Users who are viewing this thread

Back
Top Bottom