Warning: Undefined array key "msg" in /home/kksaryyu/public_html/common/top-header.php on line 51

Warning: Undefined array key "msg" in /home/kksaryyu/public_html/common/top-header.php on line 56

Warning: Undefined array key "success" in /home/kksaryyu/public_html/common/top-header.php on line 61
          Register Now  Support - Call Us : 09553760444  
Forgot Password Demo Video 

Warning: Undefined array key "err" in /home/kksaryyu/public_html/common/textsourse.php on line 37

Warning: Undefined array key "err" in /home/kksaryyu/public_html/common/textsourse.php on line 40

Warning: Undefined array key "suc" in /home/kksaryyu/public_html/common/textsourse.php on line 43
Test Our Service | Enter Mobile Number   +91     

Resources - Send SMS API library


Code to send SMS in VB.NET


Code Sample:

Private Function SendSMS_txtLocal(ByVal Test As Boolean, _
ByVal From As String, _
ByVal Message As String, _
ByVal SendTo As String, _
ByVal URL As String) As String
    ' Send a message using the txtLocal transport
    Const TransportURL As String =" https://www.bulksmsgateway.in/sendmessage.php"
    Const TransportUserNameAs String =9030888111
    Const TransportPasswordAs String ="mypassword"
    Const TransportVerboseAs Boolean =True
    Dim strPost As String
    ' Build POST String

    strPost = "user=" + TransportUserName + "&password=" + TransportPassword + "&message=" + System.Web.HttpUtility.UrlEncode(Message) + 
        "&sender=" + OPTINS + "&mobile=" + SendTo + "&type=1"

    If URL = "" Then
        strPost += "&url=" + URL
    End If

    If Test = True Then
        strPost += "&test=1"
    End If

    If TransportVerbose =True Then
        strPost += "&info=1"
    End If

    ' Create POST
    Dim request As WebRequest = WebRequest.Create(TransportURL)
    request.Method = "POST"
    Dim byteArray As Byte() = Encoding.UTF8.GetBytes(strPost)
    request.ContentType = "application/x-www-form-urlencoded"
    request.ContentLength = byteArray.Length
    Dim dataStream As Stream = request.GetRequestStream()

    dataStream.Write(byteArray, 0, byteArray.Length)
    dataStream.Close()

    ' Get the response.
    Dim response As WebResponse = request.GetResponse()
    dataStream = response.GetResponseStream()
    Dim reader As New StreamReader(dataStream)
    Dim responseFromServerAs String = reader.ReadToEnd()

    ' Clean upthe streams.
    reader.Close()
    dataStream.Close()
    response.Close()

    ' Return result to calling function
    If responseFromServer.Length > 0 Then
    Return responseFromServer
        Else
    Return CType(response, HttpWebResponse).StatusDescription
    End If
End Function



Please note that some of the above code has been supplied to Bulk SMS Gateway by clients. As such, accuracy is not guaranteed by Bulk SMS Gateway.

Bulk SMS Service All Over India