Download the PHP package overtrue/easy-sms without Composer

On this page you can find all versions of the php package overtrue/easy-sms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package easy-sms

Easy SMS

:calling: 一款满足你的多种发送需求的短信发送组件

Build Status Latest Stable Version Latest Unstable Version Code Coverage Total Downloads License

Sponsor me

特点

  1. 支持目前市面多家服务商
  2. 一套写法兼容所有平台
  3. 简单配置即可灵活增减服务商
  4. 内置多种服务商轮询策略、支持自定义轮询策略
  5. 统一的返回值格式,便于日志与监控
  6. 自动轮询选择可用的服务商
  7. 更多等你去发现与改进...

平台支持

环境需求

安装

For Laravel notification

如果你喜欢使用 Laravel Notification, 可以考虑直接使用朋友封装的拓展包:

https://github.com/yl/easysms-notification-channel

使用

短信内容

由于使用多网关发送,所以一条短信要支持多平台发送,每家的发送方式不一样,但是我们抽象定义了以下公用属性:

所以,在使用过程中你可以根据所要使用的平台定义发送的内容。

你也可以使用闭包来返回对应的值:

你可以根据 $gateway 参数类型来判断返回值,例如:

发送网关

默认使用 default 中的设置来发送,如果某一条短信你想要覆盖默认的设置。在 send 方法中使用第三个参数即可:

返回值

由于使用多网关发送,所以返回值为一个数组,结构如下:

如果所选网关列表均发送失败时,将会抛出 Overtrue\EasySms\Exceptions\NoGatewayAvailableException 异常,你可以使用 $e->results 获取发送结果。

你也可以使用 $e 提供的更多便捷方法:

自定义网关

本拓展已经支持用户自定义网关,你可以很方便的配置即可当成与其它拓展一样的使用:

国际短信

国际短信与国内短信的区别是号码前面需要加国际码,但是由于各平台对国际号码的写法不一致,所以在发送国际短信的时候有一点区别:

定义短信

你可以根据发送场景的不同,定义不同的短信类,从而实现一处定义多处调用,你可以继承 Overtrue\EasySms\Message 来定义短信模型:

更多自定义方式请参考:Overtrue\EasySms\Message

发送自定义短信:

各平台配置说明

阿里云

短信内容使用 template + data

阿里云Rest

短信内容使用 template + data

阿里云国际

短信内容使用 template + data

发送示例:

云片

短信内容使用 content

Submail

短信内容使用 data

螺丝帽

短信内容使用 content

容联云通讯

短信内容使用 template + data

互亿无线

短信内容使用 content

聚合数据

短信内容使用 template + data

SendCloud

短信内容使用 template + data

百度云

短信内容使用 template + data

华信短信平台

短信内容使用 content

253云通讯(创蓝)

短信内容使用 content

创蓝云智

普通短信发送内容使用 content

发送示例:

变量短信发送内容使用 template + data

发送示例:

融云

短信分为两大类,验证类和通知类短信。 发送验证类短信使用 template + data

天毅无线

短信内容使用 content

twilio

短信使用 content 发送对象需要 使用+添加区号

tiniyo

短信使用 content 发送对象需要 使用+添加区号

腾讯云 SMS

短信内容使用 template + data

发送示例:

阿凡达数据

短信内容使用 template + data

华为云 SMS

短信内容使用 template + data

使用默认签名通道 default

使用指定签名通道

网易云信

短信内容使用 template + data

通知模板短信

云之讯

短信内容使用 template + data

凯信通

短信内容使用 content

七牛云

短信内容使用 template + data

Ucloud

短信使用 template + data

短信宝

短信使用 content

摩杜云

短信使用 template + data

融合云(助通)

短信使用 template + data

蜘蛛云

短信使用 template + data

融合云信

短信使用 template + data

天瑞云

短信内容使用 template + data

发送示例:

时代互联

短信使用 content

发送示例:

火山引擎

短信内容使用 template + data

发送示例1:

发送示例2:

:heart: 支持我

Sponsor me

如果你喜欢我的项目并想支持它,点击这里 :heart:

Project supported by JetBrains

Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.

PHP 扩展包开发

想知道如何从零开始构建 PHP 扩展包?

请关注我的实战课程,我会在此课程中分享一些扩展开发经验 —— 《PHP 扩展包实战教程 - 从入门到发布》

License

MIT


All versions of easy-sms with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.2 || ^7.0
php Version >=5.6
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package overtrue/easy-sms contains the following files

Loading the files please wait ....