reborn / reborn-sendsms
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:think
Requires
- php: >=7.0
- topthink/think-installer: ^2.0
This package is auto-updated.
Last update: 2024-12-19 20:23:37 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;
}
}