PHP code example of messagecloud / gateway-php

1. Go to this page and download the library: Download messagecloud/gateway-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

messagecloud / gateway-php example snippets




$objMessage = new SMSMessage(YOUR_COMPANY_NAME_HERE, YOUR_EKEY_HERE);
$objResult = $objMessage->msisdn('447528748500')->body('Hello, world!')->senderId('MessageCloud')->send();

if ($objResult->success()) {
    echo $objResult->getCallbackId();
} else {
    echo 'Error sending message! Code: ' . $objResult->getErrorCode() . ' (' . $objResult->getErrorMessage() . ')';
}

use MessageCloud\Gateway\SMSMessage as SMSMessage;
bash
$ composer 
bash
$ php test.php
123e4567-e89b-12d3-a456-426655440000