I am working in php. I want to send sms. Here i have used one api for sending sms. The code is like :
$url = "http://link.9starabs.com//httpapi/smsapi?uname=uname&password=password&sender=CARCLK&receiver=9558109779&route=T&msgtype=1&sms=Thanks for inquery ,We will contct you soon.";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
$auth = curl_exec($curl);
But I could not receive sms.When I copy this url and paste into browser then it work. So what I have to do resolve this problem?
It is working from browser means you are missing the User-Agent
header with your request. You can add the following line with your code to let curl say the request is coming from a browser.
curl_setopt($curl, CURLOPT_USERAGENT,'Mozilla/5.0');