xuezhitech / tp5-aliyun-sms
为 ThinkPHP5 开发的阿里云短信包
v1.1
2023-04-01 08:00 UTC
Requires
- topthink/framework: 5.1.*
This package is auto-updated.
Last update: 2024-09-16 05:53:30 UTC
README
## 使用 use xuezhitech\aliyunsms\SendSms; use OSS\OssClient; use OSS\Core\OssException;
// 短信配置 $this->sms_config = [ 'accessKeyId' => Env::get('sms.access_key_id'), 'accessKeySecret' => Env::get('sms.access_key_secret'), 'SignName' => Env::get('sms.sign_name'), 'TemplateCode' => Env::get('sms.template_code') ]; $this->sms = new SendSms($this->sms_config);
// data为数组,不传默认为短信验证码 $res = $this->sms->sendSms($phone,$data);