SMS API - Send SMS to many numbers at a time - IT NEWS

Latest

Programming PHP tutorials for beginners. Technology and product reviews.

Wednesday, May 3, 2017

SMS API - Send SMS to many numbers at a time

Adv
bulk sms

Send SMS to many numbers at a time

For Bulk sms (sms sending to many numbers at a time), better to use SMS API with http connection. In this example you will see how to use SMS API with PHP script for Bulk sms sending.
For bulk sms sending with PHP you can use curl. Just send php array or JSON data to SMS API link. How to prepare this array data?

If you try to insert all numbers to 'to' => "+125352352,+32324234,+234234" Nothing happens:
https://www.proovl.com/api/send.php?user=******&token=******&from=********&to=125352352,32324234,234234&text=hi

It's working only with 1 number:
https://www.proovl.com/api/send.php?user=******&token=******&from=********&to=125352352&text=hi
WRONG sample:


$postfields = array(
'user' => "user",
'token' => "token",
'to' => "+125352352,+32324234,+234234", // WRONG, Nothing happens
'text' => "$text $created"
);

Bulk SMS with API php

How to send BULK sms to many numbers at a time?
You can use foreach php function.


$to = array("4444139833", "+4444255324", "+4444366244" );

foreach ($to as $to_x => $to_y){

$text = "Hello $to_x";

$postfields = array(
'user' => "user",
'token' => "token",
'to' => "$to_y",
'text' => "$text"
);
print_r($postfields);
}


You will see this:


personalized bulk sms sending

If you want make personalized bulk sms sending. You can include names to each sms.



$to = array("Andy" => "4444139833", "Jhon" => "4444255324", "Mike" => "4444366244" );

foreach ($to as $to_x => $to_y){

$text = "Hello $to_x!";

$postfields = array(
'user' => "user",
'token' => "token",
'to' => "$to_y",
'text' => "$text"
);

print_r($postfields);
}
sms api

bulk sms

Done. Now you can send ARRAY data to SMS API link with CURL request.

Bulk SMS php SCRIPT with curl request


$user = "*****"; // SMS API USER ID
$token = "*******"; // SMS API TOKEN
$from = "******"; // SMS API number (sender ID)

$to = array("Andy" => "4444139833", "Jhon" => "4444255324", "Mike" => "4444366244" );

foreach ($to as $to_x => $to_y){

$url = "https://www.proovl.com/api/send.php";

$text = "Hello $to_x!";

$postfields = array(
'user' => "user",
'token' => "token",
'from' => "$from",
'to' => "$to_y",
'text' => "$text"
);

if (!$curld = curl_init()) {
exit;
}

curl_setopt($curld, CURLOPT_POST, true);
curl_setopt($curld, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($curld, CURLOPT_URL,$url);
curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);

$output = curl_exec($curld);

curl_close ($curld);

print_r($postfields);
}


bulk sms

You can use Bulk SMS with form for easy usage: https://sourceforge.net/projects/bulk-sms-script/


https://www.facebook.com/chakabiz
https://www.youtube.com/channel/UCYuMRNb_SRZ4FMsZjnHRZUA

4 comments:

  1. Thanks foe sharing. This blog is so informative for providing a valuable information about sending number of messages at a time. use MsgClub integration bulk sms api php code.

    ReplyDelete
  2. Our Ready php code/ script will help you to save time and efforts at a large level. Your enterprise/organization's php application can be easily integrated with our services. However, we provide ready to use bulk SMS API PHP code that helpfuls to send various information to your user's mobile.

    ReplyDelete
  3. To grow your brand, the major thing to consider is the right marketing technique because if you make any mistake in picking your marketing modes, you will not be able to get good results. I am so glad that with the help of the heymarket real estate sms, we are getting good results. Why don’t you try it too?

    ReplyDelete
  4. Such a nice article, thanks for sharing such a nice article. This article is so helpful for me Android Bulk SMS Sender.

    ReplyDelete