0

我尝试使用 php 语言向用户发送短信。我使用 curl 发送此消息,但出现此错误

{"error":"HTTP 405 Method Not Allowed"}

我使用 Clickatell 作为 sms api 。这是我的代码

echo $url= 'https://platform.clickatell.com/messages/http/sendapiKey=ordnzDdGdRhqdnjdf3ZmzYA==&to=904234234&content=your+password+is+BhSTV';

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_POST,1);
echo $response = curl_exec($ch);
4

1 回答 1

0

您的网址似乎不正确。尝试这个: https://platform.clickatell.com/messages/http/send?apiKey=ordnzDdGdRhqdnj...

于 2018-01-22T15:43:23.343 回答