forked from reactivepixel/simpleSMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
35 lines (23 loc) · 1.02 KB
/
index.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
<?php
// ==== Control Vars =======
$strFromNumber = "+1xxx";
$strToNumber = "+1xxx";
$strMsg = "Did you catch Olivier's nip slip last night? OMG right?"; //Olivier accidentally pulled up a porn site on a projector
$aryResponse = array();
// include the Twilio PHP library - download from
// http://www.twilio.com/docs/libraries/
require_once ("inc/Services/Twilio.php");
// set our AccountSid and AuthToken - from www.twilio.com/user/account
$AccountSid = "xxx";
$AuthToken = "xxx";
// ini a new Twilio Rest Client
$objConnection = new Services_Twilio($AccountSid, $AuthToken);
// Send a new outgoinging SMS by POSTing to the SMS resource */
$bSuccess = $objConnection->account->sms_messages->create(
$strFromNumber, // number we are sending From
$strToNumber, // number we are sending To
$strMsg // the sms body
);
$aryResponse["SentMsg"] = $strMsg;
$aryResponse["Success"] = true;
echo json_encode($aryResponse);