1

我已经下载了 Twilio API (PHP),并且能够成功调用 sms_messages->create。我已经阅读了三遍以上的文档并在这里检查过。但是,我的消息没有发送到我的手机。

我的 PHP 代码如下所示。

    <?php
    require_once('Services/Twilio.php');
    $sid = "AC02c3c69xxxxxxxxxxxxxxxxxxxxxxx";
    $token = "f3c343716xxxxxxxxxxxxxxxxxxxxx";
    $client = new Services_Twilio($sid, $token);
    $message = $client->account->sms_messages->create("+1404xxxxxxxxx","+919842xxxxxx", "hello good evening", array());
    echo $message->sid;

响应如下。

    SMac841db0f52100f66c754974037b7960
    SMd32abd4234142f3662bcaec6dc8722be
    SMb75a7e89643d9d515f48a031fb480f3c

上面的代码返回了消息ID,但是现在我还没有收到消息。

仅供参考 - 消息将发送到 India mobile,我使用的参数是 +91<10 digit mobile number>

我是不是哪里出错了?我的邮件是否已排队或计划稍后发送?

4

4 回答 4

4

你的代码看起来很棒!不幸的是,由于向印度移动设备发送大量垃圾邮件,以及政府关于您可以发送什么消息以及何时发送的规定,从 Twilio 向印度手机号码递送是很棘手的。这里有一个方便的指南,它将帮助您确保您的消息被发送到印度电话号码。

https://www.twilio.com/help/faq/sms/are-there-limitations-on-sending-sms-messages-to-indian-mobile-devices

于 2013-09-16T14:46:20.660 回答
1

Here is what the reply from the customer support for my query.

Hi Hasan,

Thanks for the report. Unfortunately it looks like the problem is that the phone number that was sent to +91984xx-xxxxx is registered here:

http://www.nccptrai.gov.in/nccpregistry/

Twilio SMS messages sent to India are considered promotional messages and cannot be delivered to registered phone numbers. In the future we may have the API return an error when you try to send to a registered phone number, provided that we can check the registration status in real-time.

Please let us know if you have any other questions about this issue.

Alex Chan
Twilio Customer Support
www.twilio.com

Thanks again for all the help so far.

于 2013-09-17T04:22:06.220 回答
1

你是代码很好,但你的电话号码被检查到免打扰激活。检查下面的链接。

http://www.nccptrai.gov.in/nccpregistry/search.misc

请您可以使用 Not DND 激活电话。

于 2015-01-20T09:47:39.750 回答
0

之后检查您的消息状态

$message = $client->account->sms_messages->create("+1404xxxxxxxxx","+919842xxxxxx", "hello good evening", array());

echo $message->status;

这将返回您的消息状态。

于 2015-01-03T10:25:38.120 回答