-
Notifications
You must be signed in to change notification settings - Fork 0
/
sendBulkSms.php
31 lines (25 loc) · 1.06 KB
/
sendBulkSms.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
<?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' => '02239971720',
'To' => array('09773919892', '09819295737'),
'Body' => 'Hi Shraddha, your number 9773919892 is now turned on.'
);
$exotel_sid = "student351"; // Your Exotel SID
$exotel_token = "58e19bac90649811cf506ef18036adec76138c7a"; // Your exotel token
$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);
?>