企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
> 插件说明:支持近三十家服务商的短信服务,所有涉及短信的地方都会调用此插件设置 ***** ![](https://img.kancloud.cn/a8/fe/a8feece33d4793be60a95176c2f96e23_577x707.png) ***** ### 各平台配置说明 [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E5%90%84%E5%B9%B3%E5%8F%B0%E9%85%8D%E7%BD%AE%E8%AF%B4%E6%98%8E) ### [阿里云](https://www.aliyun.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E9%98%BF%E9%87%8C%E4%BA%91) 短信内容使用`template`+`data` ~~~html 'aliyun' => [ 'access_key_id' => '', 'access_key_secret' => '', 'sign_name' => '', ], ~~~ ### [阿里云Rest](https://www.aliyun.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E9%98%BF%E9%87%8C%E4%BA%91rest) 短信内容使用`template`+`data` ~~~html 'aliyunrest' => [ 'app_key' => '', 'app_secret_key' => '', 'sign_name' => '', ], ~~~ ### [阿里云国际](https://www.alibabacloud.com/help/zh/doc-detail/160524.html) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E9%98%BF%E9%87%8C%E4%BA%91%E5%9B%BD%E9%99%85) 短信内容使用`template`+`data` ~~~html 'aliyunintl' => [ 'access_key_id' => '', 'access_key_secret' => '', 'sign_name' => '', ], ~~~ 发送示例: ~~~html use Overtrue\EasySms\PhoneNumber; $easySms = new EasySms($config); $phone_number = new PhoneNumber(18888888888, 86); $easySms->send($phone_number, [ 'content' => '您好:先生/女士!您的验证码为${code},有效时间是5分钟,请及时验证。', 'template' => 'SMS_00000001', // 模板ID 'data' => [ "code" => 521410, ], ]); ~~~ ### [云片](https://www.yunpian.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E4%BA%91%E7%89%87) 短信内容使用`content` ~~~html 'yunpian' => [ 'api_key' => '', 'signature' => '【默认签名】', // 内容中无签名时使用 ], ~~~ ### [Submail](https://www.mysubmail.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#submail) 短信内容使用`data` ~~~html 'submail' => [ 'app_id' => '', 'app_key' => '', 'project' => '', // 默认 project,可在发送时 data 中指定 ], ~~~ ### [螺丝帽](https://luosimao.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E8%9E%BA%E4%B8%9D%E5%B8%BD) 短信内容使用`content` ~~~html 'luosimao' => [ 'api_key' => '', ], ~~~ ### [容联云通讯](http://www.yuntongxun.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E5%AE%B9%E8%81%94%E4%BA%91%E9%80%9A%E8%AE%AF) 短信内容使用`template`+`data` ~~~html 'yuntongxun' => [ 'app_id' => '', 'account_sid' => '', 'account_token' => '', 'is_sub_account' => false, ], ~~~ ### [互亿无线](http://www.ihuyi.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E4%BA%92%E4%BA%BF%E6%97%A0%E7%BA%BF) 短信内容使用`content` ~~~html 'huyi' => [ 'api_id' => '', 'api_key' => '', 'signature' => '', ], ~~~ ### [聚合数据](https://www.juhe.cn/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E8%81%9A%E5%90%88%E6%95%B0%E6%8D%AE) 短信内容使用`template`+`data` ~~~html 'juhe' => [ 'app_key' => '', ], ~~~ ### [SendCloud](http://www.sendcloud.net/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#sendcloud) 短信内容使用`template`+`data` ~~~html 'sendcloud' => [ 'sms_user' => '', 'sms_key' => '', 'timestamp' => false, // 是否启用时间戳 ], ~~~ ### [百度云](https://cloud.baidu.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E7%99%BE%E5%BA%A6%E4%BA%91) 短信内容使用`template`+`data` ~~~html 'baidu' => [ 'ak' => '', 'sk' => '', 'invoke_id' => '', 'domain' => '', ], ~~~ ### [华信短信平台](http://www.ipyy.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E5%8D%8E%E4%BF%A1%E7%9F%AD%E4%BF%A1%E5%B9%B3%E5%8F%B0) 短信内容使用`content` ~~~html 'huaxin' => [ 'user_id' => '', 'password' => '', 'account' => '', 'ip' => '', 'ext_no' => '', ], ~~~ ### [253云通讯(创蓝)](https://www.253.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#253%E4%BA%91%E9%80%9A%E8%AE%AF%E5%88%9B%E8%93%9D) 短信内容使用`content` ~~~html '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退订', ], ~~~ ### [创蓝云智](https://www.chuanglan.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E5%88%9B%E8%93%9D%E4%BA%91%E6%99%BA) 普通短信发送内容使用`content` ~~~html 'chuanglanv1' => [ 'account' => '', 'password' => '', 'needstatus' => false, 'channel' => \Overtrue\EasySms\Gateways\Chuanglanv1Gateway::CHANNEL_NORMAL_CODE, ], ~~~ 发送示例: ~~~html $easySms->send(18888888888, [ 'content' => xxxxxxx ]); ~~~ 变量短信发送内容使用`template`+`data` ~~~html 'chuanglanv1' => [ 'account' => '', 'password' => '', 'needstatus' => false, 'channel' => \Overtrue\EasySms\Gateways\Chuanglanv1Gateway::CHANNEL_VARIABLE_CODE, ], ~~~ 发送示例: ~~~html $easySms->send(18888888888, [ 'template' => xxxxxx, // 模板内容 'data' => 'phone":"15800000000,1234;15300000000,4321', ]); ~~~ ### [融云](http://www.rongcloud.cn/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E8%9E%8D%E4%BA%91) 短信分为两大类,验证类和通知类短信。 发送验证类短信使用`template`+`data` ~~~html 'rongcloud' => [ 'app_key' => '', 'app_secret' => '', ] ~~~ ### [天毅无线](http://www.85hu.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E5%A4%A9%E6%AF%85%E6%97%A0%E7%BA%BF) 短信内容使用`content` ~~~html 'tianyiwuxian' => [ 'username' => '', //用户名 'password' => '', //密码 'gwid' => '', //网关ID ] ~~~ ### [twilio](https://www.twilio.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#twilio) 短信使用`content`发送对象需要 使用`+`添加区号 ~~~html 'twilio' => [ 'account_sid' => '', // sid 'from' => '', // 发送的号码 可以在控制台购买 'token' => '', // apitoken ], ~~~ ### [tiniyo](https://www.tiniyo.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#tiniyo) 短信使用`content`发送对象需要 使用`+`添加区号 ~~~html 'tiniyo' => [ 'account_sid' => '', // auth_id from https://tiniyo.com 'from' => '', // 发送的号码 可以在控制台购买 'token' => '', // auth_secret from https://tiniyo.com ], ~~~ ### [腾讯云 SMS](https://cloud.tencent.com/product/sms) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E8%85%BE%E8%AE%AF%E4%BA%91-sms) 短信内容使用`template`+`data` ~~~html 'qcloud' => [ 'sdk_app_id' => '', // 短信应用的 SDK APP ID 'secret_id' => '', // SECRET ID 'secret_key' => '', // SECRET KEY 'sign_name' => '腾讯CoDesign', // 短信签名 ], ~~~ 发送示例: ~~~html $easySms->send(18888888888, [ 'template' => 101234, // 模板ID 'data' => [ "a", 'b', 'c', 'd', //按占位顺序给值 ], ]); ~~~ ### [华为云 SMS](https://www.huaweicloud.com/product/msgsms.html) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E5%8D%8E%E4%B8%BA%E4%BA%91-sms) 短信内容使用`template`+`data` ~~~html 'huawei' => [ 'endpoint' => '', // APP接入地址 'app_key' => '', // APP KEY 'app_secret' => '', // APP SECRET 'from' => [ 'default' => '1069012345', // 默认使用签名通道号 'custom' => 'csms12345', // 其他签名通道号 可以在 data 中定义 from 来指定 'abc' => 'csms67890', // 其他签名通道号 ... ], 'callback' => '' // 短信状态回调地址 ], ~~~ 使用默认签名通道`default` ~~~html $easySms->send(13188888888, [ 'template' => 'SMS_001', 'data' => [ 6379 ], ]); ~~~ 使用指定签名通道 ~~~html $easySms->send(13188888888, [ 'template' => 'SMS_001', 'data' => [ 6379, 'from' => 'custom' // 对应 config 中的 from 数组中 custom ], ]); ~~~ ### [网易云信](https://yunxin.163.com/sms) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E7%BD%91%E6%98%93%E4%BA%91%E4%BF%A1) 短信内容使用`template`+`data` ~~~html 'yunxin' => [ 'app_key' => '', 'app_secret' => '', 'code_length' => 4, // 随机验证码长度,范围 4~10,默认为 4 'need_up' => false, // 是否需要支持短信上行 ], ~~~ ~~~html $easySms->send(18888888888, [ 'template' => 'SMS_001', // 不填则使用默认模板 'data' => [ 'code' => 8946, // 如果设置了该参数,则 code_length 参数无效 'action' => 'sendCode', // 默认为 `sendCode`,校验短信验证码使用 `verifyCode` ], ]); ~~~ 通知模板短信 ~~~html $easySms->send(18888888888, [ 'template' => 'templateid', // 模板编号(由客户顾问配置之后告知开发者) 'data' => [ 'action' => 'sendTemplate', // 默认为 `sendCode`,校验短信验证码使用 `verifyCode` 'params' => [1,2,3], //短信参数列表,用于依次填充模板 ], ]); ~~~ ### [云之讯](https://www.ucpaas.com/index.html) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E4%BA%91%E4%B9%8B%E8%AE%AF) 短信内容使用`template`+`data` ~~~html 'yunzhixun' => [ 'sid' => '', 'token' => '', 'app_id' => '', ], ~~~ ~~~html $easySms->send(18888888888, [ 'template' => 'SMS_001', 'data' => [ 'params' => '8946,3', // 模板参数,多个参数使用 `,` 分割,模板无参数时可为空 'uid' => 'hexianghui', // 用户 ID,随状态报告返回,可为空 'mobiles' => '18888888888,188888888889', // 批量发送短信,手机号使用 `,` 分割,不使用批量发送请不要设置该参数 ], ]); ~~~ ### [凯信通](http://www.kingtto.cn/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E5%87%AF%E4%BF%A1%E9%80%9A) 短信内容使用`content` ~~~html 'kingtto' => [ 'userid' => '', 'account' => '', 'password' => '', ], ~~~ ~~~html $easySms->send(18888888888, [ 'content' => '您的验证码为: 6379', ]); ~~~ ### [七牛云](https://www.qiniu.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E4%B8%83%E7%89%9B%E4%BA%91) 短信内容使用`template`+`data` ~~~html 'qiniu' => [ 'secret_key' => '', 'access_key' => '', ], ~~~ ~~~html $easySms->send(18888888888, [ 'template' => '1231234123412341234', 'data' => [ 'code' => 1234, ], ]); ~~~ ### [Ucloud](https://www.ucloud.cn/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#ucloud) 短信使用`template`+`data` ~~~html 'ucloud' => [ 'private_key' => '', //私钥 'public_key' => '', //公钥 'sig_content' => '', // 短信签名, 'project_id' => '', //项目ID,子账号才需要该参数 ], ~~~ ~~~html $easySms->send(18888888888, [ 'template' => 'UTAXXXXX', //短信模板 'data' => [ 'code' => 1234, //模板参数,模板没有参数不用则填写,有多个参数请用数组,[1111,1111] 'mobiles' =>'', //同时发送多个手机短信,请用数组[xxx,xxx] ], ]); ~~~ ### [短信宝](http://www.smsbao.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E7%9F%AD%E4%BF%A1%E5%AE%9D) 短信使用`content` ~~~html 'smsbao' => [ 'user' => '', //账号 'password' => '' //密码 ], ~~~ ~~~html $easySms->send(18888888888, [ 'content' => '您的验证码为: 6379', //短信模板 ]); ~~~ ### [摩杜云](https://www.moduyun.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E6%91%A9%E6%9D%9C%E4%BA%91) 短信使用`template`+`data` ~~~html 'moduyun' => [ 'accesskey' => '', //必填 ACCESS KEY 'secretkey' => '', //必填 SECRET KEY 'signId' => '', //选填 短信签名,如果使用默认签名,该字段可缺省 'type' => 0, //选填 0:普通短信;1:营销短信 ], ~~~ ~~~html $easySms->send(18888888888, [ 'template' => '5a95****b953', //短信模板 'data' => [ 1234, //模板参数,对应模板的{1} 30 //模板参数,对应模板的{2} //... ], ]); ~~~ ### [融合云(助通)](https://www.ztinfo.cn/products/sms) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E8%9E%8D%E5%90%88%E4%BA%91%E5%8A%A9%E9%80%9A) 短信使用`template`+`data` ~~~html 'rongheyun' => [ 'username' => '', //必填 用户名 'password' => '', //必填 密码 'signature'=> '', //必填 已报备的签名 ], ~~~ ~~~html $easySms->send(18888888888, [ 'template' => '31874', //短信模板 'data' => [ 'valid_code' => '888888', //模板参数,对应模板的{valid_code} //... ], ]); ~~~ ### [蜘蛛云](https://zzyun.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E8%9C%98%E8%9B%9B%E4%BA%91) 短信使用`template`+`data` ~~~html 'zzyun' => [ 'user_id' => '', //必填 会员ID 'secret' => '', //必填 接口密钥 'sign_name'=> '', //必填 短信签名 ], ~~~ ~~~html $easySms->send(18888888888, [ 'template' => 'SMS_210317****', //短信模板 'data' => [ 'code' => '888888', //模板参数,对应模板的{code} //... ], ]); ~~~ ### [融合云信](https://maap.wo.cn/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E8%9E%8D%E5%90%88%E4%BA%91%E4%BF%A1) 短信使用`template`+`data` ~~~html 'maap' => [ 'cpcode' => '', //必填 商户编码 'key' => '', //必填 接口密钥 'excode'=> '', //选填 扩展名 ], ~~~ ~~~html $easySms->send(18888888888, [ 'template' => '356120', //短信模板 'data' => [ '123465' ],//模板参数 ]); ~~~ ### [天瑞云](http://cms.tinree.com/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E5%A4%A9%E7%91%9E%E4%BA%91) 短信内容使用`template`+`data` ~~~html 'tinree' => [ 'accesskey' => '', // 平台分配给用户的accesskey 'secret' => '', // 平台分配给用户的secret 'sign' => '', // 平台上申请的接口短信签名或者签名ID ], ~~~ 发送示例: ~~~html $easySms->send(18888888888, [ 'template' => '123456', // 模板ID 'data' => [ "a", 'b', 'c', //按模板变量占位顺序 ], ]); ~~~ ### [时代互联](https://www.now.cn/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E6%97%B6%E4%BB%A3%E4%BA%92%E8%81%94) 短信使用`content` ~~~html 'nowcn' => [ 'key' => '', //用户ID 'secret' => '', //开发密钥 'api_type' => '', // 短信通道, ], ~~~ 发送示例: ~~~html $easySms->send(18888888888, [ 'content' => '您的验证码为: 6379', ]); ~~~ ### [火山引擎](https://console.volcengine.com/sms/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E7%81%AB%E5%B1%B1%E5%BC%95%E6%93%8E) 短信内容使用`template`+`data` ~~~html 'volcengine' => [ 'access_key_id' => '', // 平台分配给用户的access_key_id 'access_key_secret' => '', // 平台分配给用户的access_key_secret 'region_id' => 'cn-north-1', // 国内节点 cn-north-1,国外节点 ap-singapore-1,不填或填错,默认使用国内节点 'sign_name' => '', // 平台上申请的接口短信签名或者签名ID,可不填,发送短信时data中指定 'sms_account' => '', // 消息组帐号,火山短信页面右上角,短信应用括号中的字符串,可不填,发送短信时data中指定 ], ~~~ 发送示例1: ~~~html $easySms->send(18888888888, [ 'template' => 'SMS_123456', // 模板ID 'data' => [ "code" => 1234 // 模板变量 ], ]); ~~~ 发送示例2: ~~~html $easySms->send(18888888888, [ 'template' => 'SMS_123456', // 模板ID 'data' => [ "template_param" => ["code" => 1234], // 模板变量参数 "sign_name" => "yoursignname", // 签名,覆盖配置文件中的sign_name "sms_account" => "yoursmsaccount", // 消息组帐号,覆盖配置文件中的sms_account "phone_numbers" => "18888888888,18888888889", // 手机号,批量发送,英文的逗号连接多个手机号,覆盖发送方法中的填入的手机号 ], ]); ~~~ ### [移动云MAS(黑名单模式)](https://mas.10086.cn/) [](https://github.com/overtrue/easy-sms?tab=readme-ov-file#%E7%A7%BB%E5%8A%A8%E4%BA%91mas%E9%BB%91%E5%90%8D%E5%8D%95%E6%A8%A1%E5%BC%8F) 短信内容使用`template`+`data` ~~~html 'yidongmasblack' => [ 'ecName' => '', // 机构名称 'secretKey' => '', // 密钥 'apId' => '', // 应用ID 'sign' => '', // 签名 'addSerial' => '', // 通道号默认空 ], ~~~ 发送示例: ~~~html $easySms->send(18888888888, [ 'content' => '您的验证码为: 6379', ]); ~~~