How to send sms from reseller sms Gateway by using php
Create a simple function.
<?php
function sent_otp_msg($mob,$message)
{
$authKey = "YOUR_AUTH_KEY";
$mobileNumber = $mob;
$senderId = "YOUR_SENDER_ID";
$message = urlencode("$message");
$route = 4;
$postData = array(
'authkey' => $authKey,
'mobiles' => $mobileNumber,
'message' => $message,
'sender' => $senderId,
'route' => $route
);
$url="http://my.resellersms.in/api/sendhttp.php";
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postData
));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$output = curl_exec($ch);
if(curl_errno($ch))
{
echo 'error:' . curl_error($ch);
}
curl_close($ch);
return $output;
}
$ph="4578458965";
$message="4578458965";
sent_otp_msg($ph,$message)
?>
Get the latest news and updates by signing up to our daily newsletter.We won't sell your email or spam you !