Send SMS From VB.NET using HTTP API

Visual Basic .Net is a programming language mostly used to create dynamic web pages. It is widely used because of its flexibility in all fields. This guide will provide you information on how to build a Visual Basic project that can handle sending SMS to any given phone number. If you run the VB.net file, it will connect to the Ozeki SMS Gateway and handle your outgoing SMS traffic. We provide you with the required project file, you just need to modify it with you own password and username. You can follow this step-by-step guide, so the modification requires no coding skill.

How to send SMS from VB.NET using HTTP API (Simple directives)

To send SMS from VB.NET using HTTP API:

  1. Setup Microsoft Visual Studio
  2. Download the pre-built VB.net project
  3. Open OzekiSmsHttpRequest.sln
  4. Modify the source code
  5. Connect to the Ozeki SMS Gateway
  6. Run the project
  7. Type address and text message
  8. Send test SMS

Step 1 - Download the VB.NET example code

First you will need to have a starting point to begin the work. We provide you a pre-built VB.net project which only needs little modifications. To download the required file, go to the main page of the VB.net solution as you can see on Figure 1, or click the link below.

You can download send-sms-vb.net-http-sms-example.zip (106 Kb)

download the example project
Figure 1 - Download example project

Step 2 - Open the VB.NET project file

Now that you have all the required files, you need to open the code of the project to modify. You can use many developer tools to make the adjustment. We use Visual Studio as you can see on Figure 2. To open the project, search for a file called “OzekiSmsHttpRequest.sln”. If you found the file, please open it by clicking the filename, as you can see on Figure 2.

open the project file
Figure 2 - Open the project file


After you opened the text editor of your choice, you will be presented with the code of the VB.net project. Upon running it will try to connect to the Ozeki SMS Gateway, so it will need to fill in the login form with your username and password. To use the required login credentials, you need to change some code line. Please find a code line which starts with “Dim username As String =”. Here you will need to complete the snippet with your username, and the line below with your password. This way the program will know your username and password and will successfully log in to your Ozeki account. You can find the code lines on Figure 3.

modify the login creditals in the source code
Figure 3 - Modify the login credentials in the source code

To run the modified file, click the “Start” button on toolbar (in Visual Studio). Your code editor will run your program and project the outcome. You can see the start button on Figure 4.

start the project
Figure 4 - Start the project

If you run the file, a window will appear with the name “SMS Client test form”. Here you can determine the destination phone number and the message itself. If you provided all the required information, please click the “Send” button. It will connect to the Ozeki SMS Gateway and send the message. You can see the window in Figure 5.

send the test sms
Figure 5 - Send the Test SMS