How to send sms from pacttown sms gateway by using php. I am creating a simple function. It's simple and easy to integrate. Sign in to pacttown.
<?php
function sms_single($mobile,$new_otp,$body)
{
$sms_body=urlencode($body);
$timeout = 500;
$sms_url="http://login.pacttown.com/api/mt/SendSMS?user=YOURUSER&password=YOURPASS&senderid=YOURSENDERID&channel=Trans&DCS=0&flashsms=0&number=$mobile&text=".$sms_body."&route=2";
$ch=curl_init($sms_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
return "SMS sent to ".$mobile;
}
$body="My MSG";
$mobile="8574785478";
$new_otp="232345";
sms_single($mobile,$new_otp,$body);
?>
Get the latest news and updates by signing up to our daily newsletter.We won't sell your email or spam you !