<?php
//Your authentication key
$userid= YOUR_USERID;
$password=YOUR_PASSWORD;
$vasid=YOUR_VASID;
$to = "16092223333";
//Sender ID
$from = "27126";
//Text message to send, make sure to URL encode the content.
$message = urlencode("Test message");
//Prepare post parameters
$postData = array('userid' => $userid,
'password' => $password,
'vasid'=$vasid,
'to' => $to,
'text' => $message,
'from' => $from);
//API URL
$url="https://msgapi.wire2air.com/smsapi/submitsm.aspx";
// init the resource
$ch = curl_init();
curl_setopt_array(
$ch,
array( CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS =>
$postData
));
//Ignore SSL certificate verification
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
//get response
$output = curl_exec($ch);
//Print error if any
if(curl_errno($ch))
{ echo 'error:' . curl_error($ch); }
curl_close($ch);
echo $output;
?>