-1

I can send sms when a user click on a button but i can't send sms when a user set a time or date and sms will send autometic on that times. in the below code is when a user click on a button for sent sms. Now what thinks should i change to solved my problem.Please help me i need help.

<?php 
    require __DIR__ . '/vendor/autoload.php';
    use Twilio\Rest\Client;
    /*echo '+'.$_REQUEST['mobile'];*/
    if (isset($_REQUEST['mobile'])) {
        $sid = '';
        $token = '';

        /*$client = new Twilio\Rest\Client($sid,$token);*/
        $client = new Client($sid, $token);
        $message = $client->messages->create(
            '+'.$_REQUEST['mobile'], 
            array(
                'from' => '',
                'body' => 'testing'
            )
        );
    }

?>
Foisal Hossain
  • 129
  • 1
  • 8

1 Answers1

-1

You Have to add Country code with Plus sign Like +1 for USA and +91 for India.

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

    if (isset($_REQUEST['mobile'])) {
        $sid = '';
        $token = '';

        $client = new Client($sid, $token);
        $message = $client->messages->create(
            '+{Country_Code}'.$_REQUEST['mobile'], 
            array(
                'from' => '',
                'body' => 'testing'
            )
        );
    }