-
Notifications
You must be signed in to change notification settings - Fork 1
/
sms.php3.bak
34 lines (26 loc) · 1.28 KB
/
sms.php3.bak
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
<?php
$post_data = array(
// 'From' doesn't matter; For transactional, this will be replaced with your SenderId;
// For promotional, this will be ignored by the SMS gateway
'From' => '8808891988',
//'To' => '8019582131',
'To' => '9052637737',
'Body' => 'Hi this shruthi laya ', //Incase you are wondering who Dr. Rajasekhar is http://en.wikipedia.org/wiki/Dr._Rajasekhar_(actor)
);
$exotel_sid = "student75"; // Your Exotel SID - Get it from here: http://my.exotel.in/Exotel/settings/site#api-settings
$exotel_token = "f8c6c580a2915d273f8952f390b598e8bfb53387"; // Your exotel token - Get it from here: http://my.exotel.in/Exotel/settings/site#api-settings
$url = "https://".$exotel_sid.":".$exotel_token."@twilix.exotel.in/v1/Accounts/".$exotel_sid."/Sms/send";
$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
$http_result = curl_exec($ch);
$error = curl_error($ch);
$http_code = curl_getinfo($ch ,CURLINFO_HTTP_CODE);
curl_close($ch);
print "Response = ".print_r($http_result);
?>