$key, 'user' => $user, 'pass' => $pass, 'sender' => $sender, 'recipient' => $recipient, 'msg' => $msg ); $data_string = json_encode($postdata); $ch = curl_init($url); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 400); set_time_limit(0); $data = curl_exec($ch); $curl_errno = curl_errno($ch); $curl_error = curl_error($ch); curl_close($ch); if ($curl_errno > 0) { echo "CURL Error ($curl_errno): $curl_error\n"; } else { echo "Data received: $data\n"; // Gives you how many recipients the message was sent to } ?>