PHP code example of sarahman / sms-gateway

1. Go to this page and download the library: Download sarahman/sms-gateway library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sarahman / sms-gateway example snippets




use Previewtechs\SMSGateway\Client;
use Previewtechs\SMSGateway\Providers\SSLWireless;
use Previewtechs\SMSGateway\SMS\Message;

ess);

$message = (new Message())
    ->setRecipient("88XXXXXXXXXXX")
    ->setMessage("YOUR MESSAGE");

try {
    $r = $client->send([$message]);
    echo $r->isSuccess() . PHP_EOL;
    print_r($r->getMessages());
} catch (Exception $e) {
    echo $e->getMessage();
}