Winter Sale

15% Free SMS - find out more here

PHP 5 Simple SMS send Class

  • Why not share:
  • Social sharing button for Facebook
  • Social sharing button for Linkedin
  • Social sharing button for Twitter
  • Social sharing button for Googleplus
  • Social sharing button for Pinterest

This blog post has been superseded with our website documentation

2 classes available in php 5, SendSMS and SendSMSXML (recommended)

Class Name: SendSMS (depreciated)

This class is a nice and easy way to start sending SMS’s with the Text Marketer system, please feel free to modify at will. You just need the username and password from your account login as the constructor arguments.

Download the PHP 5 SMS API Class

Example of use

<?
$sms = new SendSMS("myUsername","myPassword");
if($sms->send("4477777777","my message","me")) echo "message sent";
else echo "message failed";
?>

Class Name: SendSMSXML

An updated class from SendSMS which uses the XML response and is simpler to use, please feel free to modify at will. You just need the username and password from your account login as the constructor arguments.

Download PHP 5 SMS API Class

Example of use

<?
$sms = new SendSMSXML("myUsername","myPassword");
if($sms->send("4477777777","my message","me")){
 	echo "I have ".$sms->getCreditsRemaining()." left and I used  ".$sms->getCreditsUsed()." credits";
}
else {
     while($error = $sms->getError())
     {
         echo $error;
     }
}
?>

No related posts.

Latest posts