PHPackages                             lonelythinker/yii2-sms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lonelythinker/yii2-sms

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

lonelythinker/yii2-sms
======================

Yii2 SMS extension

3421PHP

Since Feb 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/lonelythinker/yii2-sms)[ Packagist](https://packagist.org/packages/lonelythinker/yii2-sms)[ RSS](/packages/lonelythinker-yii2-sms/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

yii2-sms
========

[](#yii2-sms)

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

支持接口：

- [创蓝](http://www.cl2009.com/)
- [短信宝](http://api.smsbao.com/)
- [云通讯](http://www.yuntongxun.com/)
- [中国云信](http://www.sms.cn/)
- [中国网建](http://www.smschinese.cn/)
- [商信通](http://www.sxtsms.com/)
- [云片网络](http://www.yunpian.com/)

安装
--

[](#安装)

执行

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

```

或者添加

```
"lonelythinker/yii2-sms": "*"

```

到 `composer.json` 文件的`require` 块。

Usage
-----

[](#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
-------

[](#license)

**yii2-sms** is released under the Apache-2.0 License. See the bundled `LICENSE` for details.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca5ed0ac6e4cafeccc97c4537edcda751d98c65310fb2ae36bc9ba06f9999ac2?d=identicon)[lonelythinker](/maintainers/lonelythinker)

---

Top Contributors

[![lonelythinker](https://avatars.githubusercontent.com/u/6228718?v=4)](https://github.com/lonelythinker "lonelythinker (33 commits)")

### Embed Badge

![Health badge](/badges/lonelythinker-yii2-sms/health.svg)

```
[![Health](https://phpackages.com/badges/lonelythinker-yii2-sms/health.svg)](https://phpackages.com/packages/lonelythinker-yii2-sms)
```

###  Alternatives

[dmore/chrome-mink-driver

Mink driver for controlling chrome without selenium

7514.5M345](/packages/dmore-chrome-mink-driver)[kalessil/production-dependencies-guard

Prevents adding of development packages into require-section (should be require-dev).

851.2M2](/packages/kalessil-production-dependencies-guard)[nikic/include-interceptor

Intercept PHP includes

6967.4k2](/packages/nikic-include-interceptor)[artgris/maintenance-bundle

Symfony Bundle to place your Symfony website in maintenance mode

2697.5k](/packages/artgris-maintenance-bundle)[wemersonrv/input-mask

A Laravel Nova custom field text with masks on input

1196.4k](/packages/wemersonrv-input-mask)[daveawb/understated

A PHP Finite State Machine for Laravel 5+

302.0k](/packages/daveawb-understated)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
