Send SMS to Mobile from your website

In this post we will see how we can send SMS from a website to user’s mobile phone.
This can be helpful if you want to verify user’s mobile number, send them OTP (One Time Password)
or send them order confirmation etc.

In this example we will use and integrate a third party SMS API called www.textlocal.com
We will be using its PHP library to send SMS and offcourse Textlocal.com provides libraries for couple of other programming launguages like JAVA, Python, .NET etc. You can create a Free account (and it will provide you couple of free SMS which you can use for testing/while development).

Steps:

1. Sign-Up for Textlocal.com account
2. Once account has been created, login to your account, you will be landed to the dashboard.
3. On Menu Bar goto Help -> All documents ( As shown in below Screenshot)

text login dashboard

4. You will get your API hash code there. Then click to the PHP code link just below that, as shown in below screenshot, you will get a sample PHP integration code there, copy that code and save that in a .php file (smsapi.php in my case).

textlogin-api-key

Sample code shown below:

Now, let’s quickly create an HTML form,

Form and result will look like below:

Message SMS On Mobile

Similarly, Using textlocal.com API, you can also send Bulk SMSs.

An example is given below:

Note: 1. for this post we are not able to give Live demo (due to limited SMS requests).

References:

Documentation

— Send SMS to Mobile from your website —

Leave a Reply

Your email address will not be published. Required fields are marked *