Wallogit.com
2017 © Pedro Peláez
A sms extension for yii2 frameworks
This is a sms extension of Yii2 framewoks., (*1)
It can be used to send sms with different service providers in an easy way., (*2)
SMS Service Providers list:, (*3)
创蓝(Chuanglan):koenigseggposche\sms\target\ChuanglanTarget 国都(Guodu):koenigseggposche\sms\target\GuoduTarget
The preferred way to install this extension is through composer., (*4)
Either run, (*5)
php composer.phar require koenigseggposche/yii2-sms "dev-master"
or add, (*6)
"koenigseggposche/yii2-sms": "dev-master"
to the require section of your composer.json file., (*7)
Configure Yii2 component:, (*8)
[
'components' => [
'sms' => [
'class' => 'koenigseggposche\sms\Sms',
'targets' => [
[
'class' => 'koenigseggposche\sms\target\ChuanglanTarget',
],
[
'class' => 'koenigseggposche\sms\target\GuoduTarget',
],
],
],
],
];
Configure Yii2 param:, (*9)
[
'chuanglan' => [
'url' => 'http://222.73.117.158/msg/HttpBatchSendSM',
'account' => 'YOUR_ACCOUNT',
'pswd' => 'YOUR_PASSWORD',
],
'guodu' => [
'url' => 'http://221.179.180.158:9008/HttpQuickProcess/submitMessageAll',
'OperID' => 'YOUR_ACCOUNT',
'OperPass' => 'YOUR_PASSWORD',
],
];
Send sms:, (*10)
<?php
$mobile = '13500000000';
$message = 'test message';
Yii::$app->sms->send($mobile, $message);
?>