Wallogit.com
2017 © Pedro Peláez
Sending SMS via the Nexmo SMS gateway., (*1)
$sms = new NexmoMessage('account_key', 'account_secret');
$sms->sendText( '+447234567890', 'MyApp', 'Hello world!' );
$sms = new NexmoMessage('account_key', 'account_secret');
if ($sms->inboundText()) {
$sms->reply('You said: ' . $sms->text);
}
$receipt = new NexmoReceipt();
if ($receipt->exists()) {
switch ($receipt->status) {
case $receipt::STATUS_DELIVERED:
// The message was delivered to the handset!
break;
case $receipt::STATUS_FAILED:
case $receipt::STATUS_EXPIRED:
// The message failed to be delivered
break;
}
}
$account = new NexmoAccount('account_key', 'account_secret');
$numbers = $account->numbersList();
This is usually due to your webserver unable to send a request to Nexmo. Make sure the following are met:, (*2)
Either CURL is enabled for your PHP installation or the PHP option allow_url_fopen is set to 1 (default)., (*3)
You have no firewalls blocking access to rest.nexmo.com/sms/json on port 443., (*4)