我一直在寻找类似的主题,但找不到任何解决方案,我希望有人可以帮助我..
注意:我在 xampp localhost 上运行脚本,我的国家代码是 +90 我按照 Nexmo 文档发送短信。下面是php脚本。
<?php
$url = 'https://rest.nexmo.com/sms/json?' . http_build_query(
[
'api_key' => 'xxxxxxxx',
'api_secret' => 'xxxxxxxxxxx',
'to' => 90542xxxxxxx,
'from' => 'MyCompanyName',
'text' => 'Working'
]
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
echo $response;
?>
以下是结果。似乎它正在发送它但是我没有在我的手机上收到短信可能会导致这种情况?
{ "message-count": "1", "messages": [{ "to": "90542xxxxxxx", "message-id": "0C00000016FF36E9", "status": "0", "remaining-balance": "1.77080000", "message-price": "0.01910000", "network": "28602" }] }