Brief IntroductionAli Big Fish has been integrated into the Aliyun inside the Aliyun-products-SMS services
1.SDK and demo Download Click to open the link
2. After decompression, the Msg_demo and Msg_sdk folder deletion is placed under Thinkphp\library\vendor (Alidayu name is set by itself) 3. Will Thinkphp\library\vendor\alidayu\api_ demo\smsdemo.php Call Instance Delete 4.app\home\controller\sendsmscontroller.class.php Invocation instance
<?php
namespace Home\controller;
Require_once (vendor_path. ' alidayu/api_demo/smsdemo.php ');
Class sendsmscontroller{public
function Send ($phone, $yzm) {
//Invoke Sample
header (' Content-type:text/plain; Charset=utf-8 ');
$demo = new Smsdemo (
"Youraccesskeyid",
"Youraccesskeysecret"
);
echo "smsdemo::sendsms\n";
$response = $demo->sendsms (
"SMS Signature",//SMS signature
"sms_0000001",//SMS Template number
"12345678901",//SMS receiver
Array ( ///SMS template in the field of the value
"code" => "12345",
"Product" => "DSD"
)
);
Print_r ($response);
if ($response->code = = ' OK ') {return
true;
} else{return
false;}}
SMS signature and SMS template number to Aliyun application 5. Information sent successfully stdClass Object
(
[Message] => OK
[RequestID] => e830799e-d93b-417e-aa80-34e88a68b08b
[Bizid] => 393004808220517089^0
[Code] => OK
) 6. SMS Interface Call error code
Click to open the link