Yii2 SMS extension
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
yunpian
.gitignore
Chuanglan.php
README.md
Sms.php
Smsbao.php
Sxt.php
Webchinese.php
Yunpian.php
Yuntongxun.php
Yunxin.php
composer.json

README.md

yii2-sms

Yii2 SMS extension (基于yii2的短信扩展)

支持接口:

安装

执行

$ php composer.phar require lonelythinker/yii2-sms "*"

或者添加

"lonelythinker/yii2-sms": "*"

composer.json 文件的require 块。

Usage

return [
    'components' => [
    '' => [
        // 创蓝
        'class' => 'lonelythiker\\yii2\\sms\\Chuanglan',
        'username' => 'username',
        'password' => 'password',
        'useFileTransport' => false
        ]
    ],
];

OR

return [
    'components' => [
    '' => [
        // 短信宝
        'class' => 'lonelythiker\\yii2\\sms\\Smsbao',
        'username' => 'username',
        'password' => 'password',
        'useFileTransport' => false
        ]
    ],
];

OR

return [
    'components' => [
        '' => [
            // 中国云信
            'class' => 'lonelythiker\\yii2\\sms\\Yunxin',
            'username' => 'username',
            'password' => 'password',
            'useFileTransport' => false
        ]
    ],
];

OR

return [
    'components' => [
        '' => [
            // 云片网
            'class' => 'lonelythiker\\yii2\\sms\\Yunpian',
            'apikey' => 'apikey',
            'useFileTransport' => false
        ]
    ],
];
Yii::$app->->send('15000000000', '短信内容');
// 发送模板短信
Yii::$app->->sendByTemplate('15000000000', ['123456'], 1);

License

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