"$phoneNoRecip", 'Text'=>"$msgText"); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $hostUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); // curl_setopt($ch, CURLOPT_VERBOSE, true); // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); // curl_setopt($ch, CURLOPT_CAINFO, 'cacert.pem'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // change to 1 to verify cert curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); $result = curl_exec($ch); return $result; } // This code provides an example of how you would call the SendSMS function from within // a PHP script to send a message. The response from the NowSMS server is echoed back from the script. $x = SendSMS('https://sample.smshosts.com/', 'username', 'password', '+44999999999', 'Test Message'); echo $x; ?>