daixianceng 2015-07-16 14:46:29 14315次浏览 18条评论 69 37 1

yii2-smser

Github项目主页 https://github.com/daixianceng/yii2-smser

Latest Stable Version Total Downloads Latest Unstable Version License

Yii2 SMS extension (短信扩展)

包含中国云信中国网建商信通云片网络接口

Installation

The preferred way to install this extension is through composer. Check the composer.json for this extension's requirements and dependencies.

To install, either run

$ php composer.phar require daixianceng/yii2-smser "*"

or add

"daixianceng/yii2-smser": "*"

to the require section of your composer.json file.

Usage

return [
    'components' => [
        'smser' => [
            // 中国云信
            'class' => 'daixianceng\smser\CloudSmser',
            'username' => 'username',
            'password' => 'password',
            'useFileTransport' => false
        ]
    ],
];

OR

return [
    'components' => [
        'smser' => [
            // 云片网
            'class' => 'daixianceng\smser\YunpianSmser',
            'apikey' => '9b11127a9701975c734b8aee81ee3526', // 请替换成您的apikey
            'useFileTransport' => false
        ]
    ],
];
Yii::$app->smser->send('15000000000', '短信内容');

License

yii2-smser is released under the BSD 3-Clause License. See the bundled LICENSE for details.

觉得很赞
亿速云
您需要登录后才可以评论。登录 | 立即注册