thinkphp引入 阿里大于短信平台

来源:互联网 发布:数据删除恢复软件 编辑:程序博客网 时间:2024/06/05 06:35

public function alimsg(){

$appkey = "";//你的App key
$secret = "";//你的App Secret: 
vendor('Alimsg.top.TopClient');
vendor('Alimsg.top.ResultSet');
vendor('Alimsg.top.RequestCheckUtil');
vendor('Alimsg.top.TopLogger');
vendor('Alimsg.top.request.AlibabaAliqinFcSmsNumSendRequest'); 
$c = new \TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new \AlibabaAliqinFcSmsNumSendRequest;
$req->setExtend("123456");//确定发给的是哪个用户,参数为用户id
$req->setSmsType("normal");
/*
进入阿里大鱼的管理中心找到短信签名管理,输入已存在签名的名称,这里是身份验证。
*/
$req->setSmsFreeSignName("短信测试");
$req->setSmsParam("{'num':'23123'}"); 
//这里设定的是发送的短信内容:验证码${code},您正在进行${product}身份验证,打死不要告诉别人哦!”
$req->setRecNum("xxxxxxx");//参数为用户的手机号码
$req->setSmsTemplateCode("SMS_132026199");
$resp = $c->execute($req);

var_dump($resp);

}

0 0
原创粉丝点击