Send SMS from VB.NET using just a few lines of code
Download the project or the compiled library
Imports Mediaburst.API
Imports System.Net
Module DemoSMS
Sub Main()
Try
Dim sms As SMS = New SMS("username", "password")
Dim result As SMSResult = sms.Send("44123457890", "Hello World")
If (result.Success) Then
Console.WriteLine("Sent, ID: " + result.ID)
Else
Console.WriteLine("Error: " + result.ErrorMessage)
End If
Catch ex As APIException
' You'll get an API exception for errors
' such as wrong username or password
Console.WriteLine("API Exception: " + ex.Message)
Catch ex As WebException
'Web exceptions mean you couldn't reach the mediaburst server
Console.WriteLine("Web Exception: " + ex.Message)
Catch ex As ArgumentException
' Argument exceptions are thrown for missing parameters,
' such as forgetting to set the username
Console.WriteLine("Argument Exception: " + ex.Message)
Catch ex As Exception
' Something else went wrong, the error message should help
Console.WriteLine("Unknown Exception: " + ex.Message)
End Try
End Sub
End Module
Full documentation can be found in the readme file. If you have any questions get in touch.
You might find our Mobile site useful.