PHPackages                             tlisten/aliyun-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. tlisten/aliyun-sms

ActiveYii2-extension

tlisten/aliyun-sms
==================

Aliyun SMS Sending/Yii2中支持阿里云短信发送API

1.0.0(7y ago)328MITPHPPHP &gt;=5.4.0

Since Jul 31Pushed 7y ago1 watchersCompare

[ Source](https://github.com/tlisten/aliyun-sms)[ Packagist](https://packagist.org/packages/tlisten/aliyun-sms)[ Docs](https://github.com/tlisten/aliyun-sms)[ RSS](/packages/tlisten-aliyun-sms/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

aliyun-sms
==========

[](#aliyun-sms)

Aliyun SMS Sending

阿里云短信发送 API 整合进Yii2

\#composer

```
composer require tlisten/aliyun-sms
```

\#使用 在 common/config/params.php 中增加

```
'aliyun'=>array(
        'sms'=>array(
            'accessKeyid'=>'',        //AccessKeyId  https://ak-console.aliyun.com/
            'accessKeySecre'=>'',     //AccessKeySecret  https://ak-console.aliyun.com/
            'SignName'=>'',           //必填，设置签名名称，应严格按"签名名称"填写，请参考: https://dysms.console.aliyun.com/dysms.htm#/develop/sign
            'TemplateCode'=>'',       //必填，设置模板CODE，应严格按"模板CODE"填写, 请参考: https://dysms.console.aliyun.com/dysms.htm#/develop/template
            'OutId'=>'',                // 可选，设置流水号
            'SmsUpExtendCode'=>''     // 选填，上行短信扩展码（扩展码字段控制在7位或以下，无特殊需求用户请忽略此字段）
        )
    )
```

在 common/config/models 中增加文件 AliyunSendSms.php

```
namespace common\models;

use Aliyun\AliyunSms;
use Yii;
use yii\base\Model;

class AliyunSendSms extends Model
{
    private $model;

    public function __construct(array $config = [])
    {

        $this->model = new AliyunSms(
            Yii::$app->params['aliyun']['sms']['accessKeyid'],
            Yii::$app->params['aliyun']['sms']['accessKeySecre'],
            Yii::$app->params['aliyun']['sms']['SignName'],
            Yii::$app->params['aliyun']['sms']['TemplateCode'],
            Yii::$app->params['aliyun']['sms']['OutId'],
            Yii::$app->params['aliyun']['sms']['SmsUpExtendCode']
        );

        //如果有多个签名，可用set方法设置不同的签名和模板
        //$this->model->setSignName();
        //$this->model->setTemplateCode();
        parent::__construct($config);
    }

    /**
     * User: Listen
     * Description:发送短信，返回短信结果集
     * @param $tel
     * @param $temparam
     * @return \Aliyun\stdClass
     */
    public function SendSms($tel,$temparam)
    {
        $result = $this->model->sendSms($tel,$temparam);
        return $result;
    }

    /**
     * User: Listen
     * Description:用不同的模板发送短信，返回结果集
     * @param $tel
     * @param $temparam
     * @param $TemplateCode
     * @return \Aliyun\stdClass
     */
    public function SendSmsOtherTemp($tel,$temparam,$TemplateCode)
    {
        $this->model->setTemplateCode($TemplateCode);
        $result = $this->model->sendSms($tel,$temparam);
        return $result;
    }

}
```

\#License 除 “版权所有（C）阿里云计算有限公司” 的代码文件外，遵循 [MIT license](http://opensource.org/licenses/MIT) 开源。

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

2842d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6b635a6c08873c0c30114ab7ac62cb03e6ec1e9c9746ff5ebe20efc91d25f497?d=identicon)[TListen](/maintainers/TListen)

---

Top Contributors

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

---

Tags

yii2AliyunSMS

### Embed Badge

![Health badge](/badges/tlisten-aliyun-sms/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.6k47](/packages/skeeks-cms)

PHPackages © 2026

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