首先 请下载阿里大鱼的SDK短信代码 选择PHP版本的 然后应用如下代码即可
import("@.ORG.alidayu.TopSdk","",".php"); date_default_timezone_set(‘Asia/Shanghai‘); $SmsParam = json_encode($param[‘SmsParam‘]); $c = new \TopClient; $c->method = $config[‘method‘]; $c->appkey = $config[‘appkey‘]; $c->secretKey = $config[‘secret‘]; $c->format = "json"; $req = new \AlibabaAliqinFcSmsNumSendRequest; $req->setExtend($param[‘Extend‘]); $req->setSmsType("normal"); $req->setSmsFreeSignName($param[‘SmsFreeSignName‘]); $req->setSmsParam($SmsParam); $req->setRecNum($param[‘RecNum‘]); $req->setSmsTemplateCode($param[‘SmsTemplateCode‘]); $resp = $c->execute($req, $sessionKey);
时间: 2024-11-03 20:43:59