Guest
2007-05-09T10:25:02Z
I want to send an SMS message from my ASP page but I am not able to install the COM component because my website is hosted on a shared web server.
Support
2007-05-09T10:27:36Z
The following VBScript can be used on an ASP page to send an SMS message


Function SendMessage ( Username, Password, ToNumber, From, Text ) 

	FormData = ""
	FormData = FormData & "username=" & Server.URLencode(Username)
	FormData = FormData & "&password=" & Server.URLencode(Password)
	FormData = FormData & "&to=" & Server.URLencode(ToNumber)
	FormData = FormData & "&from=" & Server.URLencode(From)
	FormData = FormData & "&text=" & Server.URLencode(Text)

	HTTPResponse = DoFormPost ( "http://www.intellisoftware.co.uk/smsgateway/sendmsg.aspx", FormData )

	'TODO: Parse HTTPResponse for message id and error code

End Function


Function DoFormPost ( URL, FormData ) 
	Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP")
	xmlhttp.Open "POST", URL, false
	xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	xmlhttp.send FormData
	DoFormPost = xmlhttp.responseText
	Set xmlhttp = nothing
End Function