Send an SMS Using VisualBasic .NET

Share on Facebook0Tweet about this on TwitterShare on LinkedIn0Share on Google+0

The TextMagic API VisualBasic.NET wrapper can save you a lot of time, as it includes all the necessary API commands and tests. It only takes a few seconds to download it from GitHub and to install it into your own app or software. After installation, you’ll then be able to send text messages.

Get it now on GitHub

Installation Instructions

Visual Studio

  1. Open your project or create a new one.
  2. Right click on the References in Solution Explorer window and select Manage NuGet Packages.
  3. When the package manager dialog appears, type TextmagicRest in the search window.
  4. Click Install.

SharpDevelop

  1. Open your project or create a new one.
  2. Click Project and choose Manage packages.
  3. When the package manager dialog appears, type TextmagicRest in the search window.
  4. Click Install.

Manual installation via the Package Manager Console

  1. Open your project or create a new one.
  2. Open the NuGet Package Manager Console from the Tools menu.
  3. Type the following command in the console:
Install-Package TextmagicRest

Requirements

The VisualBasic.NET wrapper for the TextMagic API has the following requirements:

  • NET 4.0 or higher
  • RestSharp (= 105.1.0)

Sending an SMS in Visual Basic .NET (an example)

Below is an example on how to send SMS in Visual Basic .NET:

Imports TextmagicRest
Imports TextmagicRest.Model
...
 
Public Function SendMessage()
    Dim client = New Client("test", "my-api-key")
    Dim link = client.SendMessage("Hello from TextMagic API", "447860021130")
    If link.Success Then
        Console.WriteLine("Message with ID {0} has been successfully sent", link.Id)
    Else
        Console.WriteLine("Message was not sent due to following exception: " + link.ClientException.Message)
    End If
End Function

Support

If you need help with the wrapper, or if you have any suggestions for improvements and/or if you have any enquiries regarding the VB.net SMS API, please contact us by emailing support@textmagic.com.