If this helps you . Please "Mark as Answer"
vijaya
Imports System.Net Imports System.IO Partial Class demo Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load SendSMS("18479790553", "ToNumber", "You have an appointment on 1-20-2012 at 3:00pm with Dr. McAndrews at the Carson Office. ") End Sub Sub SendSMS(ByVal FromNumber As String, ByVal ToNumber As String, ByVal SMS As String) Response.ContentType = "text/xml; charset=utf-8" Dim url As String = "https://www.sendandreceivesms.com/api/" Dim request As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest) request.Method = "POST" Dim postData As String = "FromNumber=" & FromNumber postData += "&" postData += "ToNumber=" & ToNumber postData += "&" postData += "SMS=" & SMS Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData) request.ContentType = "application/x-www-form-urlencoded" request.Headers.Add("APIToken", "GoOu9H0h9G") request.ContentLength = byteArray.Length Dim dataStream As Stream = request.GetRequestStream() dataStream.Write(byteArray, 0, byteArray.Length) dataStream.Close() Dim _webresponse As WebResponse = request.GetResponse() dataStream = _webresponse.GetResponseStream() Dim reader As New StreamReader(dataStream) Dim responseFromServer As String = reader.ReadToEnd() Response.Write(responseFromServer) reader.Close() dataStream.Close() 'Response.Close() End Sub End Class
Nick S
Login to post response