PHP code example of larc / smpp-client-php

1. Go to this page and download the library: Download larc/smpp-client-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/ */

    

larc / smpp-client-php example snippets




use Larc\SMPPClient\entities\{ServerConfig, SMS};
use Larc\SMPPClient\{SMSBuilder, SMPP, Code};

$config = new ServerConfig();
$config->setHost('127.0.0.1')
    ->setPort(1234)
    ->setSystemId('0000')
    ->setPassword('00000000')
    ->setCommandId(SMPP::BIND_TRANSCEIVER)
    ->setTon(SMPP::TON_ALPHANUMERIC)
    ->setNpi(SMPP::NPI_PRIVATE);

$sms = new SMS();
$sms->setSender('Name')
    ->setRecipient('50760001000')
    ->setMessage('Text message')
    ->setFlash(false)
    ->setUtf(false);

$SMSBuilder = new SMSBuilder($config, $timeout, $trace);
$res = $SMSBuilder->send($sms);

$sms->setFlash(true);
bash
composer