PHPackages                             gmars/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. gmars/yii2-sms

ActiveLibrary

gmars/yii2-sms
==============

a library for yii2.this library instanced SMS api include alidayu and aliyunsms and so on,i will instance all most popular SMS API

2.0.x-dev(9y ago)107305[1 issues](https://github.com/gmars/yii2-sms/issues)MITPHPPHP &gt;=5.4.0

Since Apr 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/gmars/yii2-sms)[ Packagist](https://packagist.org/packages/gmars/yii2-sms)[ Docs](http://www.weiyongqiang.com/)[ RSS](/packages/gmars-yii2-sms/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

yii2-sms
========

[](#yii2-sms)

注意：由于阿里云官方对于短信服务的调整，该组件只能支持阿里大于和阿里云短信服务(3月30日之前开通)的支持。对于阿里云并入消息服务的短信发送将会在另一个组件中实现并且以依赖的方式在后续的版本中兼容，谢谢支持！

yii2的sms扩展库，实现了阿里大鱼sms短信接口以及阿里云SMS短信接口，在后期还会实现其他一些主流短信接口。 usage： 可以在项目根目录下执行composer命令 composer require gmars/yii2-sms

```
也可以在项目的根目录的composer.json的require中添加

"gmars/yii2-sms": "dev-master"

然后运行composer update来更新项目

运行成功后就可以在项目中直接实例化使用了。
目前支持的接口有：阿里大鱼的短信接口、阿里云的云通信/短信服务接口

```

使用方式如下 \* @param string $sdkName 接口名称 \* @param array $option 接口的配置参数 $smsObj = new \\gmars\\sms\\Sms($sdkName, $options, $config = \[\]);

```
在options参数中需要以数组的形式传入appkey和secretkey

$smsObj = new Sms('ALIDAYU',['appkey'=>'2344445','secretkey'=>'xasdgdfhsfhjsfhsfhs']);
$smsObj->send([
                  'mobile' => '15730430000',
                  'signname' => 'NoStop',
                  'templatecode' => 'SMS_34000000',
                  'data' => [
                      'code' => 'asdg',
                      'time' => '2'
                  ],
              ]);

 * $args['data'] = [
 *      'mobile' => 'mobile',                   电话号码必须
 *      'signname' => 'signname',               签名必须要有
 *      'templatecode' => 'templatecode',       模板编码
 *      'smstype' => 'smstype',                 短信类型
 *      'extend' => 'extend',                   附加参数可以不传
 *      'data' => [                             数据必须以数组形式传参
 *          'code' => 'xxxx',
 *          'time' => '10'
 *      ],
 * ]

 引入阿里mns发布一个稳定包

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3301d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/521ea484a8fc6008e8576a01c9713bc3b864174c54c468622d070d1ed655c99e?d=identicon)[gmars](/maintainers/gmars)

---

Top Contributors

[![gmars](https://avatars.githubusercontent.com/u/9643824?v=4)](https://github.com/gmars "gmars (14 commits)")

---

Tags

smsyii2alidayuyii2 library

### Embed Badge

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

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

###  Alternatives

[tuyakhov/yii2-notifications

The extension provides support for sending notifications across a variety of delivery channels, including mail, SMS, Slack etc. Notifications may also be stored in a database so they may be displayed in your web interface.

6735.5k2](/packages/tuyakhov-yii2-notifications)[daixianceng/yii2-smser

Yii2 SMS extension

862.9k1](/packages/daixianceng-yii2-smser)[saviorlv/yii2-dysms

Aliyun SMS SDK for Yii2

1316.5k1](/packages/saviorlv-yii2-dysms)[abhi1693/yii2-sms

Send Free Sms for Yii2

171.9k](/packages/abhi1693-yii2-sms)

PHPackages © 2026

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