function sendSMS($mobile,$msg)
{
// configuration according to SMS gateway
$postData= array(
'user' => 'usrename',
'password' => 'password',
'mobiles' => $mobile,
'sender_id' => 'sender id',
'message' => $msg
);
// initialization
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => 'url of sms gateway',
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 the error if any
if (curl_errno($ch)) {
echo 'error:' . curl_error($ch);
}
curl_close($ch);
}
{
// configuration according to SMS gateway
$postData= array(
'user' => 'usrename',
'password' => 'password',
'mobiles' => $mobile,
'sender_id' => 'sender id',
'message' => $msg
);
// initialization
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => 'url of sms gateway',
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 the error if any
if (curl_errno($ch)) {
echo 'error:' . curl_error($ch);
}
curl_close($ch);
}
Thank you, for sharing wonderful Post. This is very informative.
ReplyDeletePhp Web Development Company Bangalore | Ecommerce Website Designer India | Internet Marketing Company in Bangalore | Magento Website Developer In India
Excellent and insightful informative blog.
ReplyDeleteAppreciate your thoughts.
Thanks for sharing...
Web design in Abu Dhabi