I have sms gateway which is used to send sms on Yii2 project. The sms is not going when i call that particular action where sms code is stored. if i print that sms url and copy paste in browser and hit it.. its going. I don't know whats wrong in Yii2.
Below is the action code and curl code is in model
public function actionMessage() {
/*sms code start*/
$model = new BillPersonal();
$mobile = "9703843454";
$authKey = "XXXXXXXXXXXXXX";
$senderId = "XXXXXX";
$textMessage = "Test Messsage";
$url = sprintf("http://www.smsgatewayhub.com/api/mt/SendSMS?APIKey=".$authKey."&senderid=".$senderId."&channel=2&DCS=0&flashsms=0&number=91".$mobile."&text=".$textMessage."&route=11");
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, $url);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_USERAGENT, 'CHMS');
$query = curl_exec($curl_handle);
}