短信网址无法处理文件操作

My question is, i'm using - $url = http://sms.emefocus.com/sendsms.jsp?user="$uname"&password="$pwd"&mobiles="$mobiil_no"&sms="$msg"&senderid="$sender_id"; $ret = file($url);- url to send sms to users from user panel and i'm using FILE operation to execute this url as mentioned above.

After executing this when i'm trying to print $ret, its giving me status true and generating message id and sending id.

But its not getting delivered to user....?? When same url i'm executing in browser as $url = http://sms.emefocus.com/sendsms.jsp?user="$uname"&password="$pwd"&mobiles=98xxxxxx02&sms=Hi..&senderid="$sender_id" its getting delivered immediately..??

can anyone help me out..?? Thanks in advance..

It is possible that this SMS service needs to think a browser and not a bot is executing the request, or there is some "protection" we don't know about. Is there any documentation regarding this particular service ? Is it intended to be used like you're trying to do?

You can try with CURL and see if the behaviour is still the same:

<?php
    // create curl resource 
    $ch = curl_init();
    $agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)';

    // set url 
    curl_setopt($ch, CURLOPT_URL, "example.com");

    // Fake real browser
    curl_setopt($curl, CURLOPT_USERAGENT, $agent);

    //return the transfer as a string 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 

    // $output contains the output string 
    $ret = curl_exec($ch); 

    // close curl resource to free up system resources 
    curl_close($ch);      
?>

Does it help?