//发送短信测试
//打开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 = '您的签名';
//发送短信
$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' => '短信内容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;
}
验证码已发送到您的手机,请查收!
输入验证码后,点击“开通体验账户”按钮可立即开通体验账户。