Welcome! Login
Contents
Sending SMS text messages using ASP.NET scripts 
Article Rating
Current Rating  
Total Votes 288 
Your Rating

Sending SMS text messages using ASP.NET scripts

By Darren C 

Sending SMS text messages using ASP.NET scripts

 
You can send SMS text messages using the following code snippet. The code uses a web service that can send an SMS text message to 90% of all mobile phones.

If you go to the URL http://www.salcentral.com/help/msgservice.com then you can download a .zip file that contains code for the whole ASP.NET project.

This .zip file is very interesting. It demonstrates how pay to use web services can be used within anyones ASP.NET project.

The code snippet to access the web service is as follows

'Before using the below code you must link the web service
'http://sal006.salnetwork.com:83/lucin/SMSMessaging/Process.xml
'Information available on www.salcentral.com

Private Sub SendMessage(ByVal p_sPhoneNumber As String, ByVal p_sMessage 
As String, ByVal p_sUsername As String, ByVal p_sPasskey As String)

    Dim smsService As New SMSService.SMSMessagingprocessService()
    Dim sCountryCodes As String

    Try

        If smsService.ValidPhoneNumber(p_sPhoneNumber) Then
            Dim result As Boolean = smsService.SendMessage(p_sPhoneNumber, 
p_sMessage, p_sUsername, p_sPasskey)
            If result = True Then
                MsgBox("The message was sent", 
MsgBoxStyle.Information, "SMS Messaging")

            Else
                MsgBox("The message could not be sent", 
MsgBoxStyle.Information, "SMS Messaging")

            End If
        End If
    Catch ex As SoapException
        MsgBox("An exception occured.  " & ex.Detail.InnerText, 
MsgBoxStyle.Critical, "SMS Messaging")
    End Try

End Sub

 
This site was generated with CodeCharge