dgwht/sms

腾讯阿里短信发送

v2.2.1 2024-10-27 16:18 UTC

This package is not auto-updated.

Last update: 2024-10-27 16:21:58 UTC


README

安装

composer require dgwht/sms

短信发送

use dgwht\Sms;

/*
Sms::setConfig('ali',[
    "id" => "LTAI4FdEgtr2kneRWgpSnzQB",
    "key" => "xxxxxxxxx",
    "sign" => "微后台",
    "tpl" => "SMS_138078698",
]);

$ret = Sms::send('18888888888',['data1' => '内容1','data2' => '内容2','data3' => '内容3']);
*/

Sms::setConfig('tx',[
    "id" => "1400158411",
    "key" => "xxxxxxxxx",
    "sign" => "泪心世界",
    "tpl" => "348208",
]);

$ret = Sms::send('18888888888',['内容1','内容2','内容3']);

if($ret === true){
    echo "发送成功";
}else{
    echo "发送失败:[{$ret}]";
}