PHPackages                             qq348069510/smsbao - 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. qq348069510/smsbao

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

qq348069510/smsbao
==================

适用于短信宝API v1 快捷工具 短信宝：http://www.smsbao.com/

v1.0.2(4y ago)0851Apache-2.0PHPPHP &gt;=5.4.0

Since Mar 19Pushed 4y agoCompare

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

READMEChangelog (3)DependenciesVersions (4)Used By (0)

短信宝快捷工具 v1.0.2
==============

[](#短信宝快捷工具-v102)

#### 介绍

[](#介绍)

适用于短信宝API v1 快捷工具 短信宝：

#### 使用说明

[](#使用说明)

1. 引入Smsbao.php文件，并引用类 `use smsbao\Smsbao;`
2. 初始化工具对象 `$smsbao = new Smsbao("短信宝平台用户名", "短信宝平台密码");`
3. 如果需要重新设置账号密码可使用 `$smsbao->setUser("短信宝平台用户名", "短信宝平台密码");`
4. 发送短信 `$smsbao->send("手机号","短信内容",发送类型);` 发送类型参数可省略，返回true为发送成功，false则是发送失败
5. 获取错误信息 `$smsbao->getErrorMessage();` 用于获取上一次失败后的错误信息
6. 提供三种发送类型（调用方式为类常量） `Smsbao::GN_SMS`：国内短信，`Smsbao::GW_SMS`：国外短信，`Smsbao::VOICE`：语音验证码，缺省值默认为国内短信
7. 查询账户余额 `$smsbao->query();` 返回内容为 \[*发送条数：x条，剩余条数：x条*\]。如果查询失败直接返回错误信息
8. 可设置是否使用SSL安全协议的安全接口请求 `$smsbao->setIsSSL(true)` true为使用SSL安全协议，false则不使用
9. 随机生成字符串助手函数，可快速生成验证码 `$smsbao->random(6,true)` 即生成长度为6位的数字验证码

#### Composer

[](#composer)

##### 安装

[](#安装)

```
composer require qq348069510/smsbao -vvv

```

##### 更新

[](#更新)

```
composer update qq348069510/smsbao -vvv

```

##### 删除

[](#删除)

```
composer remove qq348069510/smsbao -vvv

```

#### 注意事项

[](#注意事项)

为了避免被滥用，demo.php文件请在测试后删除

#### 版本日志

[](#版本日志)

##### v1.0.2

[](#v102)

```
  增加对手机号码的自动识别，当识别到手机号码中包含 + 符号则自动切换至发送国际短信
  优化对手机号码的URL编码格式化
  优化Http请求方法及代码结构

```

##### v1.0.1

[](#v101)

```
  修复对php7.4的不兼容性

```

##### v1.0.0

[](#v100)

```
  支持短信宝的发送国内外短信，语音验证码，账户余额查询功能
  支持设置是否使用SSL安全协议的安全接口
  支持随机字符串生成函数

```

#### 参与贡献

[](#参与贡献)

1. 短信宝官网开发文档()

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Every ~214 days

Total

3

Last Release

1816d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v1.0.1PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18628954?v=4)[IT老酸奶](/maintainers/qq348069510)[@qq348069510](https://github.com/qq348069510)

---

Top Contributors

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

---

Tags

smsbao

### Embed Badge

![Health badge](/badges/qq348069510-smsbao/health.svg)

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

PHPackages © 2026

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