Twilio Send SMS using PHP

In a few lines of code, your PHP application can send, receive, and reply to text messages with Twilio Programmable SMS. Download below library file and copy and paste code after setup Account ID, Auth Token, and Twilio

Download Library File

Code

require __DIR__ . '/twilio-php-master/Twilio/autoload.php';
use Twilio\Rest\Client;

$account_sid = '';
$auth_token = '';

$number = '1234567891';
$twilio_number = "+911234567891";
$client = new Client($account_sid, $auth_token);
$client->messages->create(
    '+91'.$number.'',
    array(
        'from' => $twilio_number,
        'body' => 'test message'
    )
);

Leave a Reply

Your email address will not be published. Required fields are marked *