接口合作公司 :http://sms.inolink.com/LoginFront.aspx 从这里获取id
<?php
function execPostRequest($url,$fields){
if(empty($url)){ return false;}
//$fields_string =http_build_query($post_array);
foreach($fields as $key=>$value) { $fields_string .= $key.’=’.$value.’&’; }
rtrim($fields_string,’&’);
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
//短信接口username $uid
$uid = ‘tclkj02234’;
//短信接口password $passwd
$passwd = ‘731765’;
//发送到的目标手机号码 $telphone
$telphone = ‘1863525****’;
//短信内容 $message
$message = “这是一条測试信息111111【XX】”;
$fields = array(
‘CorpID’=>urlencode($uid),
‘Pwd’=>urlencode($passwd),
‘Mobile’=>urlencode($telphone),
‘Content’=>urlencode($message),
‘Cell’=>”,
‘SendTime’=>”
);
$url = “http://inolink.com/WS/BatchSend.aspx”;
$result = execPostRequest($url,$fields);
if(0== $result)
{
echo “发送成功! 发送时间”.date(“Y-m-d H:i:s”);
}
else
{
echo “发送失败, 错误提示代码: “.$result;
}
?>
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/119147.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...