function send_sms($TemplateCode,$RecNum,$FreeSignName){ $c = new TopClient; $c->appkey = ;//appkey值 $c->secretKey = ;//secretKey值 $req = new AlibabaAliqinFcSmsNumSendRequest; //$req->setExtend("123456"); $req->setSmsType("normal"); $req->setSmsFreeSignName($FreeSignName); $req->setSmsParam("{"code":"1234","product":"alidayu"}");.//模版参数 $req->setRecNum($RecNum); $req->setSmsTemplateCode($TemplateCode); $resp = $c->execute($req); $content = json_decode(json_encode($resp),true); try { $result= $content['sub_msg']; throw new Exception('It is an exception!'); } catch (Exception $e) { if( $content['result']['success'] == 'true' ){ $result= '发送成功'; }else{ $result= '发送失败'; } } echo $result; exit(); }
新闻热点
疑难解答