php版阿里大于短信发送实例详解_php技巧_脚本之家。关于签名签名会显示在短信中,只要是允许的签名,系统的或者自己审核通过的,可以混用。

extend = $extend; $this->apiParas["extend"] = $extend; } public function getExtend() { return $this->extend; } public function setRecNum { $this->recNum = $recNum; $this->apiParas["rec_num"] = $recNum; } public function getRecNum() { return $this->recNum; } public function setSmsFreeSignName { $this->smsFreeSignName = $smsFreeSignName; $this->apiParas["sms_free_sign_name"] = $smsFreeSignName; } public function getSmsFreeSignName() { return $this->smsFreeSignName; } public function setSmsParam { $this->smsParam = $smsParam; $this->apiParas["sms_param"] = $smsParam; } public function getSmsParam() { return $this->smsParam; } public function setSmsTemplateCode { $this->smsTemplateCode = $smsTemplateCode; $this->apiParas["sms_template_code"] = $smsTemplateCode; } public function getSmsTemplateCode() { return $this->smsTemplateCode; } public function setSmsType { $this->smsType = $smsType; $this->apiParas["sms_type"] = $smsType; } public function getSmsType() { return $this->smsType; } public function getApiMethodName() { return "alibaba.aliqin.fc.sms.num.send"; } public function getApiParas() { return $this->apiParas; } public function check() { RequestCheckUtil::checkNotNull($this->recNum,"recNum"); RequestCheckUtil::checkNotNull($this->smsFreeSignName,"smsFreeSignName"); RequestCheckUtil::checkNotNull($this->smsTemplateCode,"smsTemplateCode"); RequestCheckUtil::checkNotNull($this->smsType,"smsType"); } public function putOtherTextParam { $this->apiParas[$key] = $value; $this->$key = $value; }}
// 发送大于短信 更牛逼的 protected function sendDayuSmsPlus { $dayu_template = 'dayu_template_'.$type; $signname = C($dayu_template.".signname"); $templatecode = C($dayu_template.".templatecode"); // require LIB_PATH . 'ORG/Taobao-sdk-php/TopSdk.php'; include_once LIB_PATH . 'ORG/Taobao-sdk-php/TopSdk.php'; $c = new TopClient; $c->appkey = C; $c->secretKey = C; $req = new AlibabaAliqinFcSmsNumSendRequest; $req->setSmsType; $req->setSmsFreeSignName; if  { $req->setSmsParam('{"name":"'. $data['name'] .'"}'); } if ($type == 'buysuccess') { $req->setSmsParam('{"name":"'. $data['name'] .'","product":"'. $data['product'] .'"}'); } if  { $req->setSmsParam('{"name":"'. $data['name'] .'"}'); } $req->setRecNum; $req->setSmsTemplateCode; $resp = $c->execute; return $resp; }

// 发送大于短信 更牛逼的 protected function sendDayuSmsPlus { $dayu_template = 'dayu_template_'.$type; $signname = C($dayu_template.".signname"); $templatecode = C($dayu_template.".templatecode"); // require LIB_PATH . 'ORG/Taobao-sdk-php/TopSdk.php'; include_once LIB_PATH . 'ORG/Taobao-sdk-php/TopSdk.php'; $c = new TopClient; $c->appkey = C; $c->secretKey = C; $req = new AlibabaAliqinFcSmsNumSendRequest; $req->setSmsType; $req->setSmsFreeSignName; switch { case 'sold': $req->setSmsParam('{"name":"'. $data['name'] .'"}'); break; case 'buysuccess': $req->setSmsParam('{"name":"'. $data['name'] .'","product":"'. $data['product'] .'"}'); break; case 'newagent': $req->setSmsParam('{"name":"'. $data['name'] .'"}'); break; default: $req->setSmsParam('{"code":"'. $data['code'] .'","product":"'. $data['product'] .'"}'); } $req->setRecNum; $req->setSmsTemplateCode; $resp = $c->execute; return $resp; }

希望本文所述对大家PHP程序设计有所帮助。

'xxxxxx', 'dayu_secretKey'=>'xxxxxxxxxxxxxxxxxxxxx', 'dayu_template_register' => array('signname'=>'注册验证','templatecode'=>'SMS_9655457'), 'dayu_template_alteration' => array('signname'=>'变更验证','templatecode'=>'SMS_9655454'), 'dayu_template_identity' => array('signname'=>'身份验证','templatecode'=>'SMS_9655461'), 'dayu_template_sold'=> array('signname'=>'点多多','templatecode'=>'SMS_12800188'), 'dayu_template_buysuccess'=> array('signname'=>'点多多','templatecode'=>'SMS_12775103'), 'dayu_template_newagent'=> array('signname'=>'点多多','templatecode'=>'SMS_12815193'),);

这里的require 和 include_once
还是有区别的。如果用require,重复调用方法,就会报错。Fatal error: Cannot
redeclare class。改成include_once 就可以了。

本文实例讲述了php版阿里大于短信发送实现方法。分享给大家供大家参考,具体如下:

更多关于PHP相关内容感兴趣的读者可查看本站专题:《php面向对象程序设计入门教程》、《PHP微信开发技巧汇总》、《PHP编码与转码操作技巧汇总》、《PHP网络编程技巧总结》、《PHP基本语法入门教程》、《php字符串用法总结》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总》

发表评论

电子邮件地址不会被公开。 必填项已用*标注