PHPackages                             hongyukeji/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. [Mail &amp; Notifications](/categories/mail)
4. /
5. hongyukeji/sms

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

hongyukeji/sms
==============

SMS sent, never so simple.

v1.7.1(6y ago)32.9kMITPHPPHP &gt;=5.6

Since Aug 2Pushed 5y agoCompare

[ Source](https://github.com/hongyukeji/sms)[ Packagist](https://packagist.org/packages/hongyukeji/sms)[ RSS](/packages/hongyukeji-sms/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (1)Versions (15)Used By (0)

SMS - 短信发送，从未如此简单
=================

[](#sms---短信发送从未如此简单)

[![Latest Stable Version](https://camo.githubusercontent.com/0c475311e78fdd8cdb3e7b5459181b0968b47582c3629e94e434b1ab4e4e8b9d/68747470733a2f2f706f7365722e707567782e6f72672f686f6e6779756b656a692f736d732f762f737461626c65)](https://packagist.org/packages/hongyukeji/sms)[![Total Downloads](https://camo.githubusercontent.com/a03cbf5ac4d108d2b25de79662ceb29ab459f48bd97ff71a2821a275cfc65218/68747470733a2f2f706f7365722e707567782e6f72672f686f6e6779756b656a692f736d732f646f776e6c6f616473)](https://packagist.org/packages/hongyukeji/sms)[![Latest Unstable Version](https://camo.githubusercontent.com/11b6abb8cd7977ff49c837d49920dcf2a865ecc0e60dde7721942558ab2aa59c/68747470733a2f2f706f7365722e707567782e6f72672f686f6e6779756b656a692f736d732f762f756e737461626c65)](https://packagist.org/packages/hongyukeji/sms)[![License](https://camo.githubusercontent.com/c1c88b36d8a1f22128f136bdfca99cc1ddb8f2805aeb0087f053aabf1f8f6adc/68747470733a2f2f706f7365722e707567782e6f72672f686f6e6779756b656a692f736d732f6c6963656e7365)](https://packagist.org/packages/hongyukeji/sms)

> 全网首款支持所有短信服务商，自由扩展，无缝对接。

> 采用鸿宇科技专利[《宏观设计模式》](docs/README.md)开发。

> 更多请点击

> 项目迁移至

特点
--

[](#特点)

- 支持全网络短信服务商
- 支持自由扩展且易维护

支持
--

[](#支持)

- [阿里云](https://www.aliyun.com)
- [云片网](https://www.yunpian.com)
- [腾讯云](https://cloud.tencent.com/product/sms)
- [短信宝](http://www.smsbao.com)
- [赛邮云](https://www.mysubmail.com)
- [SendCloud](https://www.sendcloud.net)
- [互亿无线](http://www.ihuyi.com)
- [创蓝253](https://www.253.com)
- 上述短信服务商比较常用，其他短信如有需要可联系[Shadow](http://wpa.qq.com/msgrd?v=3&uin=1527200768&site=qq&menu=yes)集成
- 如需支持其他短信服务商，可以自行Fork，在`src/Sms.php`中添加对应的短信发送方法即可
- 短信快速集成（参考[《宏观设计模式》](docs/README.md) — 鸿宇科技出品）

环境
--

[](#环境)

- PHP &gt;= 5.6.0

安装
--

[](#安装)

```
$ composer require hongyukeji/sms
```

使用
--

[](#使用)

> PHP框架中使用，配置文件参考 'docs/config/config.php'

> 短信发送参数详解: send(\[参数1-手机号: 支持字符串和数组格式\],\[参数2-模板: 支持模板Code和模板内容\],\[参数3-模板参数: 模板对应的参数, 数组格式\],\[参数4-短信服务商: 设置短信发送服务商, 该参数为空时调用配置文件中默认短信服务商\])

```
use HongYuKeJi\Helpers\Sms;

$config = [
    'default' => [
        'gateway' => 'aliyun',
    ],
    'gateways' => [
        'yunpian' => [
            'apikey' => '',
        ],
        'aliyun' => [
            'accessKeyId' => '',
            'accessKeySecret' => '',
            'signName' => '',
        ],
        'qcloud' => [
            'appid' => '',
            'appkey' => '',
            'smsSign' => '',
        ],
        'duanxinbao' => [
            'user' => '',
            'pass' => '',
            'signName' => '',
        ],
        'submail' => [
            'appid' => '',
            'appkey' => '',
        ],
        'sendcloud' => [
            'sms_user' => '',
            'sms_key' => '',
        ],
        'ihuyi' => [
            'apiid' => '',
            'apikey' => '',
        ],
    ],
];

$sms = new Sms($config);

// templateCode + templateParam
$resultTemplateCode = $sms->send('13800138000', 'SMS_88888888', [
    'code' => '1234',
    'time' => '15分钟',
]);

var_dump($resultTemplateCode);

// templateContent + templateParam
$resultTemplateContent = $sms->send(['13800138000', '13900139000'], '您的验证码是%s。有效期为%s，请尽快验证！', [
    'code' => '1234',
    'time' => '15分钟',
], 'duanxinbao');

var_dump($resultTemplateContent);

// return 返回值 status: success => 发送成功, fail => 发送失败
$result = [
    'status' => 'success',
    'message' => '短信发送成功！',
];
```

维护
--

[](#维护)

- Author：Shadow
- QQ：[1527200768](http://wpa.qq.com/msgrd?v=3&uin=1527200768&site=qq&menu=yes)
- Email：
- QQ交流群：[90664526](http://shang.qq.com/wpa/qunwpa?idkey=a3e498d7d3329615c9b3d1dbbbc50e43fa80b39e93a1ae78f1fb0a268f3a0476)

配置
--

[](#配置)

- [阿里云](https://help.aliyun.com/document_detail/55451.html)

> 使用说明：templateCode + templateParam

```
'aliyun' => [
    'accessKeyId' => '',
    'accessKeySecret' => '',
    'signName' => '',
],
```

- [云片网](https://www.yunpian.com/doc/zh_CN/introduction/demos/php.html)

> 使用说明：templateCode + templateParam

```
'yunpian' => [
    'apikey' => '',
],
```

- [腾讯云](https://cloud.tencent.com/document/product/382/9557)

> 使用说明：templateCode + templateParam

```
'qcloud' => [
    'appid' => '',
    'appkey' => '',
    'smsSign' => '',
],
```

- [短信宝](http://www.smsbao.com/openapi/55.html)

> 使用说明：templateContent + templateParam

```
'duanxinbao' => [
    'user' => '',
    'pass' => '',
    'signName' => '',
],
```

- [赛邮云](https://www.mysubmail.com/chs/documents/developer/t2f1J2)

> 使用说明：templateCode + templateParam

```
'submail' => [
    'appid' => '',
    'appkey' => '',
],
```

- [SendCloud](https://www.sendcloud.net/doc/sms)

> 使用说明：templateCode + templateParam

```
'sendcloud' => [
    'sms_user' => '',
    'sms_key' => '',
],
```

- [互亿无线](http://www.ihuyi.com/demo/sms/php.html)

> 使用说明：templateContent + templateParam

```
'ihuyi' => [
    'apiid' => '',
    'apikey' => '',
],
```

- [创蓝253](https://zz.253.com/api_doc/)

> 使用说明：templateContent + templateParam

```
'chuanglan' => [
    'api_send_url' => '',
    'api_variable_url' => '',
    'api_balance_query_url' => '',
    'api_account' => '',
    'api_password' => '',
    'sms_sign' => '',
],
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Every ~33 days

Recently: every ~96 days

Total

14

Last Release

2404d ago

PHP version history (2 changes)v1.2.0PHP &gt;=5.6.0

v1.3.0PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/484917e0c99c9779961352578c18bae13504567d6ec43cc3c594b3e447aad436?d=identicon)[hongyukeji](/maintainers/hongyukeji)

---

Tags

laravel-smsphp-smssmsthinkphp-smsyii-smssmslaravel-smsphp-smsthinkphp smsyii-sms

### Embed Badge

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

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

###  Alternatives

[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[mageplaza/module-smtp

SMTP Extension for Magento 2 helps the owner of store simply install SMTP (Simple Mail Transfer Protocol) server which transmits the messages into codes or numbers

3015.9M8](/packages/mageplaza-module-smtp)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[siam-yon/sms

php实现的极简短信发送功能，基于阿里云、腾讯云最新短信发送api

142.1k](/packages/siam-yon-sms)[daaner/turbosms

TurboSMS for Laravel 7+

2333.6k](/packages/daaner-turbosms)[nutnet/laravel-sms

Package for sending SMS form your Laravel app, includes pre-installed sms providers and your custom.

2526.6k](/packages/nutnet-laravel-sms)

PHPackages © 2026

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