VB.NET CODE

Imports System.Data
Imports System.IO
Imports System.Configuration
Imports System
Imports System.Net
Imports System.Text

Public Function SendSMS(ByVal User As String, ByVal password As String, ByVal Mobile_Number As String, ByVal Message As String, Optional ByVal MType As String = "N") As String
        Dim stringpost As String = "User=" & User & "&passwd=" & password & "&mobilenumber=" & Mobile_Number & "&message=" & Message & "&MTYPE=" & MType
        'Response.Write(stringpost)
        Dim functionReturnValue As String = Nothing
        functionReturnValue = ""

        Dim objWebRequest As HttpWebRequest = Nothing
        Dim objWebResponse As HttpWebResponse = Nothing
        Dim objStreamWriter As StreamWriter = Nothing
        Dim objStreamReader As StreamReader = Nothing

        Try
            Dim stringResult As String = Nothing

        objWebRequest = DirectCast(WebRequest.Create("http://Domain name/WebserviceSMS.aspx"), HttpWebRequest)
//domain name: Domain name Replace With Your Domain 
            objWebRequest.Method = "POST"

            ' Response.Write(objWebRequest)

            ' Use below code if you want to SETUP PROXY.
            'Parameters to pass: 1. ProxyAddress 2. Port
            'You can find both the parameters in Connection settings of your internet explorer.

            ' If you are in the proxy then Uncomment below lines and enter IP and Port.
           ' Dim myProxy As New Net.WebProxy("192.168.1.108", 6666)
            'myProxy.BypassProxyOnLocal = True
            'objWebRequest.Proxy = myProxy

            objWebRequest.ContentType = "application/x-www-form-urlencoded"

            objStreamWriter = New StreamWriter(objWebRequest.GetRequestStream())
            objStreamWriter.Write(stringpost)
            objStreamWriter.Flush()
            objStreamWriter.Close()

            objWebResponse = DirectCast(objWebRequest.GetResponse(), HttpWebResponse)


            objWebResponse = DirectCast(objWebRequest.GetResponse(), HttpWebResponse)

            objStreamReader = New StreamReader(objWebResponse.GetResponseStream())
            stringResult = objStreamReader.ReadToEnd()
            objStreamReader.Close()
            Return (stringResult)
        Catch ex As Exception
            Return (ex.ToString)
        Finally

            If (objStreamWriter IsNot Nothing) Then
                objStreamWriter.Close()
            End If
            If (objStreamReader IsNot Nothing) Then
                objStreamReader.Close()
            End If
            objWebRequest = Nothing
            objWebResponse = Nothing

        End Try
    End Function

    Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsubmit.Click
        Dim str As String
        str = SendSMS(Trim(User1.Value), Passwd.Value, mobilenumber.Value, message.Value)
        Response.Write(str)
    End Sub