我的问题有点奇怪。我从我的提供商那里得到了这个 bulksms api:
http://www.estoresms.com/smsapi.php?username=user&password=1234&sender=@@sender@@&recipient=@@recipient@@&m
essage=@@message@@&
然后我将它包装在 PHP 中并在 cURL 中传递:
$api = "http://www.estoresms.com/smsapi.php?username=".$sms_user."&password=".$sms_pwd."&sender=".$sender_id."&recipient=".$numbers."&message=".$text."&";
function curl_get_contents($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$send_it = curl_get_contents($api);
通常,它工作得很好,但是当 $recepient(电话号码)超过 300 时,我得到一个错误:
Request-URI Too Long 请求的 URL 的长度超过了此服务器的容量限制。此外,在尝试使用 ErrorDocument 处理请求时遇到 414 Request-URI Too Long 错误。
但是 BulkSMS 应该能够一次发送到数千个号码。根据我的研究,我发现 URL 是有限制的。我不是服务器所有者。我正在制定一个共享托管计划。请问我该如何解决这个问题。我知道有一个解决方案并不意味着购买我自己的服务器。
谢谢