Jerry Splendour
Jerry Splendour

Reputation: 31

Unable to send Programmable sms to Philippines numbers (Twilio)

am finding it difficult to send an sms to a Philippines number using the example from the Twilio SMS PHP Quickstart documentation...

here's my code

require __DIR__ . '/vendor/autoload.php';
use Twilio\Rest\Client;

$account_sid = 'XXXXXXXXXXXX'; /////my account_sid
$auth_token = 'XXXXXXXXXX'; ////my auth_token
$client = new Client($account_sid, $auth_token);
$twilio_number = "+XXXXXXXXXXX";////// my twilio_number 
$number = "XXXXXXXXXX"; /////Philippines number 12 digits


$client->messages->create(
          // Where to send a text message (your cell phone?)
          '+'.$number,
          array(
              'from' => $twilio_number,
              'body' => 'My Twilio Message'
          )
      );
  echo json_encode('done');

it works with other countries like the US, Canada etc. At least I've tried those and they work. Anybody with an idea please ?

Upvotes: 1

Views: 591

Answers (1)

Jerry Splendour
Jerry Splendour

Reputation: 31

After contacting Twilio support, they helped me realize that I had not enabled geo permission to send SMS towards these countries, rookie mistake ...

Any one having this issue, you can click here to enable this setting.

Upvotes: 1

Related Questions