<% MsgBox(SendSMS("http://www.smsglobal.com/http-api.php", SmsGlobalData("USERNAME", _ "PASSWORD", _ "SENDER_ID", _ "DESTINATION", _ "TEXT: HELLO WORLD"))) Private Function SMSGlobalData(ByVal username As String, _ ByVal password As String, _ ByVal source As String, _ ByVal destination As String, _ ByVal text As String) As String Dim postData As New System.Text.StringBuilder("action=sendsms") postData.Append("&user=") : postData.Append(System.Web.HttpUtility.UrlEncode(username)) postData.Append("&password=") : postData.Append(System.Web.HttpUtility.UrlEncode(password)) postData.Append("&from=") : postData.Append(System.Web.HttpUtility.UrlEncode(source)) postData.Append("&to=") : postData.Append(System.Web.HttpUtility.UrlEncode(destination)) postData.Append("&text=") : postData.Append(System.Web.HttpUtility.UrlEncode(text)) Return postData.ToString() End Function Private Function SendSms(ByVal url As String, _ ByVal postData As String) As String Dim encoding As New System.Text.UTF8Encoding() Dim data As Byte() = encoding.GetBytes(postData) Dim smsRequest As HttpWebRequest = System.Net.WebRequest.Create(url) smsRequest.Method = "POST" smsRequest.ContentType = "application/x-www-form-urlencoded" smsRequest.ContentLength = data.Length Dim smsDataStream As System.IO.Stream smsDataStream = smsRequest.GetRequestStream() smsDataStream.Write(data, 0, data.Length) smsDataStream.Close() Dim smsResponse As System.Net.WebResponse = smsRequest.GetResponse() Dim responseBuffer(smsResponse.ContentLength - 1) As Byte smsResponse.GetResponseStream().Read(responseBuffer, 0, smsResponse.ContentLength - 1) smsResponse.Close() Return encoding.GetString(responseBuffer) End Function %>