示例#1
0
use IdacMedia\IntelliSms\IntelliSms;
include 'IntelliSms.php';
//Required php.ini settings:
// allow_url_fopen = On
// track_errors = On
//
//NOTE: To use https you will need the OpenSSL extension module
$sendresult_detailed = "";
$sendresult_summary = "";
if (isset($_POST['recipients']) && strlen($_POST['recipients']) != 0 && isset($_POST['udhex'])) {
    $objIntelliSMS = new IntelliSms();
    //Set you account login details below:
    $objIntelliSMS->Username = '******';
    $objIntelliSMS->Password = '******';
    //Send message
    $SendStatusCollection = $objIntelliSMS->SendBinaryMessage($_POST['recipients'], $_POST['udhhex'], $_POST['udhex'], $_POST['from']);
    //Generate result summaries for display in browser
    $sendresult_detailed = "<b>Result Details:</b><br>";
    $sendcount = 0;
    foreach ($SendStatusCollection as $SendStatus) {
        $sendresult_detailed = $sendresult_detailed . $SendStatus["To"] . "  " . $SendStatus["MessageId"] . "  " . $SendStatus["Result"] . "<BR>";
        if ($SendStatus["Result"] == "OK") {
            $sendcount++;
        }
    }
    $sendresult_summary = $sendcount . " out of " . count($SendStatusCollection) . " messages have been sent ok";
}
?>