0

我想做群发短信服务。

我有一个 Api,我们必须在其中提供收件人号码为 92312xxxxxx

 ETC 12 Numeric Characters

我想制作批量短信服务并能够一键发送,例如:

Recipient Parameters
92312xxxxxxx,92323xxxxxxx,923xxxxxxxxx, .......... up to End

我已经深入搜索但完全不知道该怎么做?

进一步的收件人号码也有一些限制,即参数

Restrictions

Parameter Error 1 = RECIPIENT Can't be Greater than 12 or Less Than 12

Parameter Error 2 = Recipient First Third Characters Are 923

如果发生任何错误:

*跳过错误的号码并转到下一个收件人
*从 SQL 表中并排减少一列一乘一(余额)

如果在过程中 Sql 列值达到零,则停止整个过程并回显:您已使用您的信用

<?php
$mysender2 = "Not Use";
$myrecepient2 = "923126812536";
$msg = "The Message That Will Go Again Again In Curl Untill Process Complete 

or SQL Column Reached Zero";

$url = "https://rest.nexmo.com/sms/json?" .
         "api_key=".$api_key. "&" .
         "api_secret="  .$api_secret . "&" .
         "from="  . urlencode($mysender2) . "&" .
         "to=" . urlencode($myrecepient2) . "&" .
         "text=" .urlencode($msg);


$c = curl_init($url); 

// Use SSL 
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, FALSE); 
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2); 
curl_setopt($c, CURLOPT_RETURNTRANSFER, TRUE); 
$html = curl_exec($c); 
?>
4

0 回答 0