Example #1
0
 public function sendSMS($sms, $number)
 {
     $kirimsms = new Outbox();
     $kirimsms->TextDecoded = $sms;
     $kirimsms->DestinationNumber = $number;
     $jmlSMS = ceil(strlen($sms) / 153);
     if ($jmlSMS > 1) {
         $kirimsms->MultiPart = "true";
     } else {
         $kirimsms->MultiPart = "false";
     }
     $kirimsms->CreatorID = "Gammu";
     if ($kirimsms->save()) {
         //            echo "Succes Sent";
     } else {
         //            echo "Halo";
         print_r($kirimsms->getErrors());
     }
     //        die();
 }
Example #2
0
 public function sendSMS($sms, $number)
 {
     if (empty($number)) {
         return false;
     }
     $kirimsms = new Outbox();
     $kirimsms->TextDecoded = $sms;
     $kirimsms->DestinationNumber = $number;
     $jmlSMS = ceil(strlen($sms) / 153);
     if ($jmlSMS > 1) {
         $kirimsms->MultiPart = "true";
     } else {
         $kirimsms->MultiPart = "false";
     }
     $kirimsms->CreatorID = "Gammu";
     if ($kirimsms->save()) {
     } else {
         print_r($kirimsms->getErrors());
     }
     return true;
 }