Example Code: How to Send SMS from PHP (via Clickatell)

advertisement logo

 

Hi there, due to popular demand (requests sent to my personal email – mypapit -at- gmail.com).

I decided to share my old post regarding my simple SendSMS php class which can help php developers to send SMS from their web application

require('SendSMS.php');

$sendsms = new SendSMS("username","password","HTTP POST API key");

/* if the login return 0, means that login failed, you cant send sms after this */
if  (  ($sendsms->login()) == 0  ) {
    die( "failed");
}

/*other wise, you can send sms using the simple send() call*/
 $sendsms->send("0132073011","can you receive this message? Hello there....");

Requirements
To use SendSMS class, you need:

That’s it.. contact me if you’ve more questions

Download SendSMS PHP class (version 0.5)
.
.
.


Share this post

Tags: , , , , , , , , , , , ,

Keep updated with the latest posts, be a part of over 1,000 subscribers! : email iconSubscribe to your email

5 smashing comments for this post.

  1. Shimul Khan Said:

    Thank you for sharing this. But there is any script exist that work with my server no need to register on other blog. just sent sms by uploading the script on server

  2. mypapit (Admin) Said:

    care to point out where we can find the script?

  3. Pitso Said:

    very nice article…i have successfully send message through Clickatell, but i also get this message :
    Deprecated: Function split() is deprecated in C:\xampp\htdocs\api\SendSMS.php on line 61.

  4. mypapit (Admin) Said:

    Pitso, in a production server you should turn off the deprecated warning, it’s a good security practice

  5. mypapit (Admin) Said:

    Pitso, another option is to replace ‘split’ with ‘explode’ in the php class

Leave a Comment

Subscribe by email

Enter your Email