Search code examples
phpapitwiliosendmessagesms-gateway

Twilio SMS Messages not being delivered to my Indian mobile phone number


I have downloaded the Twilio API (PHP) and I was able to invoke the sms_messages->create successfully. I have read the documentation more than three times and checked here also. However my messages are not getting delivered to my cellphone.

My PHP code looks like this.

    <?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;

The response is given below.

    SMac841db0f52100f66c754974037b7960
    SMd32abd4234142f3662bcaec6dc8722be
    SMb75a7e89643d9d515f48a031fb480f3c

The above code returns the message ID, but still now I have not received the message.

FYI - The message is to be delivered to India mobile and the parameter I have used is +91<10 digit mobile number>

Did I go wrong somewhere? Is my message queued or scheduled for later delivery?


Solution

  • Your code looks great! Unfortunately delivery to Indian mobile numbers from Twilio is tricky due to the high amounts of spam messages delivered to Indian mobile devices, and government regulations about what messages you can send and when. There is a handy guide here, that will help you ensure your messages get delivered to Indian phone numbers.

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