-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSMS_OK_sms.php
37 lines (36 loc) · 1.23 KB
/
SMS_OK_sms.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
function SendSMS($mobilenumbers,$message)
{
$user="bcebti"; //your username
$password="909938537"; //your password
$senderid="SUNSFT"; //Your senderid
//$url="http://smsapple.in/api/swsend.asp";//URL To HIT
$url= "http://bulksms.mysmsmantra.com:8080/WebSMS/SMSAPI.jsp";//?username="+uid+"&password="+pwd+"&sendername="+sender+"&mobileno="+mobileno+"&message="+msg;
$message = urlencode($message);
$ch = curl_init();
if (!$ch){die("Couldn't initialize a cURL handle");}
$ret = curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt ($ch, CURLOPT_POSTFIELDS,
"username=$user&password=$password&sendername=$senderid&mobileno=$mobilenumbers&message=$message");
$ret = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$curlresponse = curl_exec($ch); // execute
if(curl_errno($ch))
echo "";
//echo 'curl error : '. curl_error($ch);
if (empty($ret))
{
// some kind of an error happened
//die(curl_error($ch));
curl_close($ch); // close cURL handler
}
else
{
$info = curl_getinfo($ch);
curl_close($ch); // close cURL handler
return $curlresponse;
}
}
?>