descom/sms-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

descom/sms-php

Composer 安装命令:

composer require descom/sms-php

包简介

Build your SMS application with PHP, easy SMS sending and worldwide coverage

README 文档

README

Build Status StyleCI Latest Stable Version Total Downloads License

PHP SMS sending

SMS Library for sending text messages to mobile numbers worldwide from your own application via Descom SMS gateway.

Create your free account at Descom SMS and buy credits for SMS sending when required.

Our API documentation is available here. Also, we will be happy to assist you at soporte@descom.es for further info on your SMS project.

Installation

You can install it with composer:

composer require descom/sms-php

Usage

Send single SMS

This is an example:

$sms = new Sms(new AuthUser('your_username', 'your_password'));

$message = new Message();

$message->addTo('mobile_number')->setText('message_text');

$result = $sms->addMessage($message)
        ->setDryrun(true)
        ->send();

Send multiple SMS

You can send multiple SMS in one go, function addTo:

//...

$message->addTo('mobile_number_1')
        ->addTo('mobile_number_2');

//...

or with an Array:

//...

$message->addTo([
    'mobile_number_1',
    'mobile_number_2'
]);
//...

Check your account balance

The function getBalance allows you to check your SMS balance, this is your credit available. Example:

$sms = new Sms(new AuthUser('replace_by_your_usernme', 'replace_by_your_password'));

$balance = $sms->getBalance();

echo 'Your balance is '.$balance."\n";

Get list of senderID authorized

The function getSenderID allows you get the list of senderID authorized. Example:

$sms = new Sms(new AuthUser('replace_by_your_usernme', 'replace_by_your_password'));

$senderID = $sms->getSenderID();

echo 'Your balance is '.PHP_EOL;
print_r($senderID);

Setup your sender ID

Alphanumeric sender ID allows you to set your name or business brand as the sender ID. Use the function setSenderID at Descom\Sms\Message class

$message->setSenderID('replace_by_sender_of_message');

Note your sender ID should previously be added in your Descom SMS account setup.

Test your SMS sending application for free

Test your SMS sending application at no cost by using function setDryrun in the class Descom\Sms\Sms and set to true

$sms->setDryrun(true);

Dryrun just simulates SMS sending; no message will be sent out and no SMS credit will be deducted from your account.

Examples

Examples available at folder Examples.

统计信息

  • 总下载量: 240
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固