//發(fā)送短信測試
//打開php.ini文件中的 always_populate_raw_post_data = -1;
header("Content-type:text/html; charset=UTF-8");
require 'ihuyi/sms.class.php';
$config = require 'ihuyi/config.php';
$sms = new sms($config);
$mobile = array('XXXXXX','XXXXXX');
$content = makecontent();
$title = "測試";
$product_id = 1016;
$sign_name = '您的簽名';
//發(fā)送短信
$res = $sms->send($mobile, $content,$title, $product_id, $sign_name);
$sms->log('send', $res);
print_r($res);
function makecontent()
{
$data = array(
//第一幀
array(
array(//文本
'con_type' => 'text',
'ext_type' => 'txt',
'data' => '短信內(nèi)容1'
),
array(//圖片
'con_type' => 'image',
'ext_type' => 'jpg',
'data' => base64_encode(file_get_contents('yourFileFolder/test-jpg1.jpg'))
)
),
array(//第二幀
array(//音頻
'con_type' => 'audio',
'ext_type' => 'mp3',
'data' => base64_encode(file_get_contents('yourFileFolder/test-mp31.mp3'))
),
array(//文本
'con_type' => 'text',
'ext_type' => 'txt',
'data' => '第二幀音頻'
),
),
array(//第三幀
array(//視頻
'con_type' => 'video',
'ext_type' => 'mp4',
'data' => base64_encode(file_get_contents('yourFileFolder/test-mp41.mp4'))
)
)
);
return $data;
}
驗證碼已發(fā)送到您的手機(jī),請查收!
輸入驗證碼后,點擊“開通體驗賬戶”按鈕可立即開通體驗賬戶。