reborn / reborn-sendsms
v0.4
2019-04-19 06:57 UTC
Requires
- php: >=7.0
- topthink/think-installer: ^2.0
This package is auto-updated.
Last update: 2024-09-19 19:53:15 UTC
README
发送短信
1.在config目录下新增sendsms.php
return [
'txy_appid' =>'xxxx',//短信appid
'txy_appkey' =>'xxxx',//短信key
'txy_url' =>'xxxxx',//短信联系
'checkurl' =>'xxxx',//网站链接
'tpl_1' =>'xxxx',//模板id
'tpl_content_1' =>'xxxx',//模板内容
];
2、demo
<?php
namespace app\index\controller;
use reborn\sendsms\SendSms;
class Index
{
public function sendsms()
{
$phone='158xxx';//手机号
$data=mt_rand('100000','999999');//短信1的内容
$param=[$data];
$res=(new SendSms())->send($phone,1,$param);
return $res;
}
}