Skip to content

Commit 5bd0d51

Browse files
committed
sending an SMS
1 parent c6dc8bc commit 5bd0d51

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

sms/send-sms.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
require_once __DIR__ . '/../config.php';
3+
4+
require_once __DIR__ . '/../vendor/autoload.php';
5+
6+
$basic = new \Nexmo\Client\Credentials\Basic(NEXMO_API_KEY, NEXMO_API_SECRET);
7+
8+
$client = new \Nexmo\Client(new \Nexmo\Client\Credentials\Container($basic));
9+
10+
$message = $client->message()->send([
11+
'to' => NEXMO_TO_NUMBER,
12+
'from' => NEXMO_FROM_NUMBER,
13+
'text' => 'Test message from the Nexmo PHP Client'
14+
]);
15+
16+
var_dump($message->getResponseData());

0 commit comments

Comments
 (0)