-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend_sms.php
More file actions
25 lines (23 loc) · 759 Bytes
/
send_sms.php
File metadata and controls
25 lines (23 loc) · 759 Bytes
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
<?php
require_once 'vendor/autoload.php'; // Path to Composer autoload
use Twilio\Rest\Client;
// Your Twilio credentials
$sid = "AC93317c16ab24251d856012fe13fafd3b"; // From Twilio dashboard
$token = "c6b606e33a993fdc02bcc961efdaa496"; // From Twilio dashboard
$twilio_number = "+17755082867"; // Your Twilio phone number
$recipient_number = "+63 997 218 1003"; // User's phone number
$message = "Hello! This is a test SMS from your capstone project.";
try {
$client = new Client($sid, $token);
$client->messages->create(
$recipient_number,
[
'from' => $twilio_number,
'body' => $message
]
);
echo "SMS sent successfully!";
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
}
?>