1. Go to this page and download the library: Download krisciunaskarolis/bulksms 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/ */
krisciunaskarolis / bulksms example snippets
$smsSender = new \Krisciunas\BulkSms\Sender\SmsSender();
$recipientPhoneNumbers = [
'37066666661',
'37066666662',
'37066666663'
];
$messages = [];
foreach ($recipientPhoneNumbers as $phoneNumber) {
$messages[] = new \Krisciunas\BulkSms\Message\SmsMessage(
//Sender name (sender ID), sender must be confirmed before sending SMS message
sender: 'Test',
//Phone number of recipient
recipientPhoneNumber: $phoneNumber,
message: 'This is test message for first recipient!', //Message
//Should message be opened on receiver's screen
flash: \Krisciunas\BulkSms\Message\SmsMessageInterface::FLASH_NOT_REQUIRED,
//Is it test message
test: \Krisciunas\BulkSms\Message\SmsMessageInterface::TEST_MODE_SUCCESS,
);
}
$result = $smsSender->send('[API_KEY]', $messages); //replace [API_KEY] with your BulkSMS API key
$result = $smsSender->send('[API_KEY]', $messages); //replace [API_KEY] with your BulkSMS API key
foreach ($result as $logRecord) {
$status = $logRecord->getStatusCode();
$messageId = $logRecord->getMessageId();
$recipientPhoneNumber = $logRecord->getRecipientPhoneNumber();
$isAccepted = $logRecord->isAccepted();
}
php sendSmsMessages.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.