PHP code example of ensostudio / sms-smsc

1. Go to this page and download the library: Download ensostudio/sms-smsc 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/ */

    

ensostudio / sms-smsc example snippets


$gateway = new \EnsoStudio\Sms\Gateway\SmscGateway(
    ['apiKey' => '...'],
    new \GuzzleHttp\Client(),
    new \GuzzleHttp\Psr7\HttpFactory()
);
$result = $gateway->sendSms('Test message', [\EnsoStudio\Sms\PhoneUtils::sanitizeNumber('+7 905 710-71-71')]);
if (!$result->isSuccess()) {
    // error handler for $result->getErrors()
}