ThinkSSL🔒 一键申购 5分钟快速签发 30天无理由退款 购买更放心 广告
配置位于`addons/easysms/config/smsconfig.php` `gateways`参数里面配置默认网关 ``` <?php return [ // HTTP 请求的超时时间(秒) 'timeout' => 5.0, // 默认发送配置 'default' => [ // 网关调用策略,默认:顺序调用 'strategy' => \Overtrue\EasySms\Strategies\OrderStrategy::class, // 默认可用的发送网关 可以多个 'gateways' => [ 'submail', ], ], // 可用的网关配置 'gateways' => [ 'errorlog' => [ 'file' => '/tmp/easy-sms.log', ], //阿里云 'aliyun' => [ 'access_key_id' => '', 'access_key_secret' => '', 'sign_name' => '', ], //阿里云Rest 'aliyunrest' => [ 'app_key' => '', 'app_secret_key' => '', 'sign_name' => '', ], //云片 'yunpian' => [ 'api_key' => '', 'signature' => '【默认签名】', // 内容中无签名时使用 ], //Submail 'submail' => [ 'app_id' => '', 'app_key' => '', 'project' => '', // 默认 project,可在发送时 data 中指定 ], //更多配置... ], ]; ``` ## 各平台配置说明 ### [阿里云](https://www.aliyun.com/) 短信内容使用 `template` + `data` ```php 'aliyun' => [ 'access_key_id' => '', 'access_key_secret' => '', 'sign_name' => '', ], ``` ### [阿里云Rest](https://www.aliyun.com/) 短信内容使用 `template` + `data` ```php 'aliyunrest' => [ 'app_key' => '', 'app_secret_key' => '', 'sign_name' => '', ], ``` ### [云片](https://www.yunpian.com) 短信内容使用 `content` ```php 'yunpian' => [ 'api_key' => '', 'signature' => '【默认签名】', // 内容中无签名时使用 ], ``` ### [Submail](https://www.mysubmail.com) 短信内容使用 `data` ```php 'submail' => [ 'app_id' => '', 'app_key' => '', 'project' => '', // 默认 project,可在发送时 data 中指定 ], ``` ### [螺丝帽](https://luosimao.com/) 短信内容使用 `content` ```php 'luosimao' => [ 'api_key' => '', ], ``` ### [容联云通讯](http://www.yuntongxun.com) 短信内容使用 `template` + `data` ```php 'yuntongxun' => [ 'app_id' => '', 'account_sid' => '', 'account_token' => '', 'is_sub_account' => false, ], ``` ### [互亿无线](http://www.ihuyi.com) 短信内容使用 `content` ```php 'huyi' => [ 'api_id' => '', 'api_key' => '', 'signature' => '', ], ``` ### [聚合数据](https://www.juhe.cn) 短信内容使用 `template` + `data` ```php 'juhe' => [ 'app_key' => '', ], ``` ### [SendCloud](http://www.sendcloud.net/) 短信内容使用 `template` + `data` ```php 'sendcloud' => [ 'sms_user' => '', 'sms_key' => '', 'timestamp' => false, // 是否启用时间戳 ], ``` ### [百度云](https://cloud.baidu.com/) 短信内容使用 `template` + `data` ```php 'baidu' => [ 'ak' => '', 'sk' => '', 'invoke_id' => '', 'domain' => '', ], ``` ### [华信短信平台](http://www.ipyy.com/) 短信内容使用 `content` ```php 'huaxin' => [ 'user_id' => '', 'password' => '', 'account' => '', 'ip' => '', 'ext_no' => '', ], ``` ### [253云通讯(创蓝)](https://www.253.com/) 短信内容使用 `content` ```php 'chuanglan' => [ 'account' => '', 'password' => '', // 国际短信时必填 'intel_account' => '', 'intel_password' => '', // \Overtrue\EasySms\Gateways\ChuanglanGateway::CHANNEL_VALIDATE_CODE => 验证码通道(默认) // \Overtrue\EasySms\Gateways\ChuanglanGateway::CHANNEL_PROMOTION_CODE => 会员营销通道 'channel' => \Overtrue\EasySms\Gateways\ChuanglanGateway::CHANNEL_VALIDATE_CODE, // 会员营销通道 特定参数。创蓝规定:api提交营销短信的时候,需要自己加短信的签名及退订信息 'sign' => '【通讯云】', 'unsubscribe' => '回TD退订', ], ``` ### [融云](http://www.rongcloud.cn) 短信分为两大类,验证类和通知类短信。 发送验证类短信使用 `template` + `data` ```php 'rongcloud' => [ 'app_key' => '', 'app_secret' => '', ] ``` ### [天毅无线](http://www.85hu.com/) 短信内容使用 `content` ```php 'tianyiwuxian' => [ 'username' => '', //用户名 'password' => '', //密码 'gwid' => '', //网关ID ] ``` ### [twilio](https://www.twilio.com) 短信使用 `content` 发送对象需要 使用`+`添加区号 ```php 'twilio' => [ 'account_sid' => '', // sid 'from' => '', // 发送的号码 可以在控制台购买 'token' => '', // apitoken ], ``` ### [腾讯云 SMS](https://cloud.tencent.com/product/sms) 短信内容使用 `content` ```php 'qcloud' => [ 'sdk_app_id' => '', // SDK APP ID 'app_key' => '', // APP KEY 'sign_name' => '', // 短信签名,如果使用默认签名,该字段可缺省(对应官方文档中的sign) ], ``` ### [阿凡达数据](http://www.avatardata.cn/) 短信内容使用 `template` + `data` ```php 'avatardata' => [ 'app_key' => '', // APP KEY ], ``` ### [华为云 SMS](https://www.huaweicloud.com/product/msgsms.html) 短信内容使用 `template` + `data` ```php 'huawei' => [ 'endpoint' => '', // APP接入地址 'app_key' => '', // APP KEY 'app_secret' => '', // APP SECRET 'from' => [ 'default' => '1069012345', // 默认使用签名通道号 'custom' => 'csms12345', // 其他签名通道号 可以在 data 中定义 from 来指定 'abc' => 'csms67890', // 其他签名通道号 ... ], 'callback' => '' // 短信状态回调地址 ], ``` ### [网易云信](https://yunxin.163.com/sms) 短信内容使用 `template` + `data` ```php 'yunxin' => [ 'app_key' => '', 'app_secret' => '', 'code_length' => 4, // 随机验证码长度,范围 4~10,默认为 4 'need_up' => false, // 是否需要支持短信上行 ], ``` ### [云之讯](https://www.ucpaas.com/index.html) 短信内容使用 `template` + `data` ```php 'yunzhixun' => [ 'sid' => '', 'token' => '', 'app_id' => '', ], ``` ### [凯信通](http://www.kingtto.cn/) 短信内容使用 `content` ```php 'kingtto' => [ 'userid' => '', 'account' => '', 'password' => '', ], ``` ### [七牛云](https://www.qiniu.com/) 短信内容使用 `template` + `data` ```php 'qiniu' => [ 'secret_key' => '', 'access_key' => '', ], ```