sinbadxiii/sms-api-php

此包的最新版本(dev-master)没有提供许可证信息。

dev-master 2019-04-24 06:33 UTC

This package is auto-updated.

Last update: 2024-09-12 13:47:36 UTC


README

短信发送库

网关列表

  • SemySMS

入门

需求

使用此组件,您至少需要

  • Composer
  • PHP >= 5.5

注意:对旧版PHP版本(至7.0)的支持基于最大努力原则。

安装

Composer

$ php composer require sinbadxiii/sms-api-php

或创建以下格式的 composer.json 文件

{
    "require": {
        "sinbadxiii/sms-api-php": "dev-master"
    }
}

使用

SemySMS网关的示例


$authParam = [
    'token'  => 'xxxxxxx',
    'device' => 'yyyy'
];

$smsGatawey = new \Sinbadxiii\Gateway\GatewaySemySMS(
                                  $authParam
                              );

$sms = new \Sinbadxiii\SMS($smsGatawey);

$message = "Hello! How are you do?";
$phone   = "+7xxxxxxxxx";

$sms->send($message, $phone);