Here is a special tool for sending bulk SMS. This tool works for any API but I used the best one which is telnyx and here I am using a GSM encoder when the message is delivered it will automatically decode lets understand by example.
Follow some steps:
Step 1 - Download the telnyx SDK, Create composer.JSON file and put the following code
composer.JSON
{
"require": {
"telnyx/telnyx-php": "^2.5",
"defuse/php-encryption": "^2.3"
}
}
Then execute command in your root directory, see the screenshot below:
C:\xampp\htdocs\telnyx-smstool>composer update
Now you have installed encryption and telnyx then cresate the index.php file and put the following code
Index.php
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<style>
body{
background: #656262;
}
body .col-md-8{
border: 1px solid #6d6d6d;
padding: 20px;
margin-top: 10%;
}
.form-control{
background: #d4cdcd;
border: 1px solid #6d6d6d!important;
}
#submit-btn{
background: #283944;
border: none;
}
#responce{
color: #fff;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col"></div>
<div class="col-md-8">
<div class="mb-3">
<img src="logo.png" style="width:70px;">
</div>
<div id="responce"></div>
<form action="" method="post" enctype="multipart/form-data">
<div class="row mb-3">
<div class="col">
<textarea placeholder="Number List" id="numbers" class="form-control" rows="5"></textarea>
</div>
<div class="col">
<textarea placeholder="Message" id="message" class="form-control" rows="5"></textarea>
</div>
</div>
<div class="row mb-3">
<div class="col">
<textarea placeholder="Encrytped Messages" id="encymessage" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="row mb-3">
<div class="d-grid gap-2">
<input class="btn btn-primary btn-lg" type="button" id="submit-btn" value="Send Now" onclick="start_sendig();">
</div>
</div>
</form>
<footer class="text-center">SMS spam Tool @Antispam</footer>
</div>
<div class="col"></div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="assets/main.js" type="text/javascript"></script>
</body>
</html>
Step 2:
Create the GSM encoder file and put the following code
<?php
class GsmEncoder {
/**
* Encode an UTF-8 string into GSM 03.38
* Since UTF-8 is largely ASCII compatible, and GSM 03.38 is somewhat compatible, unnecessary conversions are removed.
* Specials chars such as € can be encoded by using an escape char \x1B in front of a backwards compatible (similar) char.
* UTF-8 chars which doesn't have a GSM 03.38 equivalent is replaced with a question mark.
* UTF-8 continuation bytes (\x08-\xBF) are replaced when encountered in their valid places, but
* any continuation bytes outside of a valid UTF-8 sequence is not processed.
*
* @param string $string
* @return string
*/
public static function utf8_to_gsm0338($string) {
$dict = array(
'@' => "\x00", '£' => "\x01", '$' => "\x02", '¥' => "\x03", 'è' => "\x04", 'é' => "\x05", 'ù' => "\x06", 'ì' => "\x07", 'ò' => "\x08", 'Ç' => "\x09", 'Ø' => "\x0B", 'ø' => "\x0C", 'Å' => "\x0E", 'å' => "\x0F",
'Î???' => "\x10", '_' => "\x11", 'Φ' => "\x12", 'Γ' => "\x13", 'Λ' => "\x14", 'Ω' => "\x15", 'Î ' => "\x16", 'Ψ' => "\x17", 'Σ' => "\x18", 'Θ' => "\x19", 'Ξ' => "\x1A", 'Æ' => "\x1C", 'æ' => "\x1D", 'ß' => "\x1E", 'É' => "\x1F",
// all \x2? removed
// all \x3? removed
// all \x4? removed
'Ä' => "\x5B", 'Ö' => "\x5C", 'Ñ' => "\x5D", 'Ü' => "\x5E", '§' => "\x5F",
'¿' => "\x60",
'ä' => "\x7B", 'ö' => "\x7C", 'ñ' => "\x7D", 'ü' => "\x7E", 'à ' => "\x7F",
'^' => "\x1B\x14", '{' => "\x1B\x28", '}' => "\x1B\x29", '\\' => "\x1B\x2F", '[' => "\x1B\x3C", '~' => "\x1B\x3D", ']' => "\x1B\x3E", '|' => "\x1B\x40", '€' => "\x1B\x65"
);
$converted = strtr($string, $dict);
// Replace unconverted UTF-8 chars from codepages U+0080-U+07FF, U+0080-U+FFFF and U+010000-U+10FFFF with a single ?
return preg_replace('/([\\xC0-\\xDF].)|([\\xE0-\\xEF]..)|([\\xF0-\\xFF]...)/m', '?', $converted);
}
/**
* Count the number of GSM 03.38 chars a conversion would contain.
* It's about 3 times faster to count than convert and do strlen() if conversion is not required.
*
* @param string $utf8String
* @return integer
*/
public static function countGsm0338Length($utf8String) {
$len = mb_strlen($utf8String, 'utf-8');
$len += preg_match_all('/[\\^{}\\\~€|\\[\\]]/mu', $utf8String, $m);
return $len;
}
/**
* Pack an 8-bit string into 7-bit GSM format
* Returns the packed string in binary format
*
* @param string $data
* @return string
*/
public static function pack7bit($data) {
$l = strlen($data);
$currentByte = 0;
$offset = 0;
$packed = '';
for ($i = 0; $i < $l; $i++) {
// cap off any excess bytes
$septet = ord($data[$i]) & 0x7f;
// append the septet and then cap off excess bytes
$currentByte |= ($septet << $offset) & 0xff;
// update offset
$offset += 7;
if ($offset > 7) {
// the current byte is full, add it to the encoded data.
$packed .= chr($currentByte);
// shift left and append the left shifted septet to the current byte
$currentByte = $septet = $septet >> (7 - ($offset - 8 ));
// update offset
$offset -= 8; // 7 - (7 - ($offset - 8))
}
}
if ($currentByte > 0)
$packed .= chr($currentByte); // append the last byte
return $packed;
}
}
multiple_number.php
<?php
require_once './vendor/autoload.php';
include './transmitter.php';
include './gsmencoder.php';
if (isset($_POST['numbers'])) {
$numbers = $_POST['numbers'];
$message = $_POST['message'];
foreach (explode("+", $numbers) as $phone) {
\Telnyx\Telnyx::setApiKey(""); //api key
$new_message = \Telnyx\Message::Create([
'from' => "",//twilio number
'to' => "+" . $phone,
'text' => $message
]);
if ($new_message) {
$data = array(
"response" => "success",
"current" => '+' . $phone
);
echo json_encode($data);
}
}
}else{
echo "Please add your number list and message!";
}
transmitter.php
<?php
require_once "../smpp.php";
$tx = new SMPP('192.168.1.90', 5018); // make sure the port is integer
$tx->debug = false;
$tx->bindTransmitter("username", "password");
$result = $tx->sendSMS("2121", "999999999", "Hello world");
$tx->getStatusMessage($result);
$tx->close();
unset($tx);
?>
Thanks.