Programming Logics FORUMS

Full Version: How to send sms to mobile using asp.net?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys
I heard that we can send SMS to mobiles using asp.net with mobile tools available in .net. can any one tell me how to do that??
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 http://www.salcentral.com
Code:
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

ORIGINALLY POSTED AT http://www.gotocode.com/art.asp?art_id=66
Reference URL's