Sending Message using message gateway!.....Please help

Hi,

Please check the script below and let me know if I mistook somewhere.

There is no error on page…Please let me know if there is something missing in code.

THanks for your help in advance!!!


                         $user="user"; 
			//your username 
			$password="password"; 
			//your password 
			$mobilenumbers=$row['pt_mobile']; 
			//enter Mobile numbers comma seperated 
			$message = $ms; 
			//enter Your Message 
			$senderid="DEMO"; 
			//Your senderid 
			$messagetype="N"; 
			//Type Of Your Message 
			$url="http://sms.domain.com/WebserviceSMS.aspx";
			 //http://domainname/WebServiceSMS.aspx? User=$user&passwd=$password&mobilenumber=xxxxxxx,xxxxxxx,xxxxxxxxx&message=xx xxxxxxx&sid=xxxxxxxx&mtype=N
			//domain name: Domain name Replace With Your Domain 
			$message = urlencode($message); 
			$ch = curl_init(); 
			if (!$ch){die("Couldn't initialize a cURL handle");}
			$ret = curl_setopt($ch, CURLOPT_URL,$url);
			curl_setopt ($ch, CURLOPT_POST, 1); 
			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
			curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); 
			curl_setopt ($ch, CURLOPT_POSTFIELDS, "User=$user&passwd=$password&mobilenumber=$mobilenumbers&message=$message&sid=$senderid&mtype=$messagetype"); 
			$ret = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
			//If you are behind proxy then please uncomment below line and provide your proxy ip with port. 
			// $ret = curl_setopt($ch, CURLOPT_PROXY, "PROXY IP ADDRESS:PORT"); $curlresponse = curl_exec($ch); 
			 execute if(curl_errno($ch)) echo 'curl error : '. curl_error($ch); if (empty($ret)) {
			some kind of an error happened die(curl_error($ch)); curl_close($ch); 
			close cURL handler;
			} 
			else 
			{
			$info = curl_getinfo($ch); curl_close($ch); 
			close cURL handler; 
			echo "<br>"; echo $curlresponse; 
			echo "Message Sent Succesfully";
			}


Place the following at the top of your script, it should help you find the problem.


<?php
error_reporting(-1);
ini_set('display_errors', true);

Are you hosting this web-service yourself or is this hosted by a third party?