PHP code example of granam / smsbranacz
1. Go to this page and download the library: Download granam/smsbranacz 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/ */
granam / smsbranacz example snippets
use \Granam\SmsBranaCz\SmsSender;
try {
$smsSender = new SmsSender('your_smsbrana_cz_login', 'your_smsbrana_cz_password', new \GuzzleHttp\Client(['connection_timeout' => 30]));
$smsSender->send(
'+420123456789', // phone number
'Your account has been activated, enjoy!' // message text
);
} catch (\Granam\SmsBranaCz\Exceptions\Exception $smsException) {
\trigger_error('Could not sent SMS: ' . $smsException->getMessage(), E_USER_WARNING);
}