yii2-smser
Github项目主页 https://github.com/daixianceng/yii2-smser
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 therequiresection of yourcomposer.jsonfile.
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 bundledLICENSEfor details.
扫码二维码 获取免费视频学习资料

- 本文固定链接: http://phpxs.com/post/4245/
- 转载请注明:转载必须在正文中标注并保留原文链接
- 扫码: 扫上方二维码获取免费视频资料
查 看2022高级编程视频教程免费获取