phpsmsmessagebird

MessageBird sms not sending (php)


I have been trying to send SMS messages with PHP using MessageBird. Currently I'm getting no error messages but I'm not receiving the messages on my phone, but I can see my free SMS credits being deducted.

<?php

    require('header.php');
    require 'php-rest-api-master/autoload.php';   

    $client = new \MessageBird\Client('YOUR_ACCESS_KEY'); // Access key goes here

    $message = new \MessageBird\Objects\Message();
    $message->originator = 'Test';
    $message->recipients = ['YOUR_PHONE_NUMBER'];
    $message->body = 'Hello, your meeting request has been processed';

    try{
        $response = $client->messages->create($message);
    } catch (Exception $e){
        echo $e->getMessage();
    }

    require('footer.php');

?>

I was wondering if there was anything I was missing?


Solution

  • One option for debugging would be to check the SMS logs in the Dashboard.

    https://developers.messagebird.com/quickstarts/sms/troubleshooting/