发短信接口获取验证码

发短信接口获取验证码

接口合作公司  :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;
}

?>

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/119147.html原文链接:https://javaforall.net

(0)
上一篇 2021年11月15日 下午3:00
下一篇 2021年11月15日 下午3:00


相关推荐

  • ip协议——ip报文格式[通俗易懂]

    ip协议——ip报文格式[通俗易懂]版本:占4位,指IP协议的版本号。目前的主要版本为IPV4,即第4版本号,也有一些教育网和科研机构在使用IPV6。在进行通信时,通信双方的IP协议版本号必须一致,否则无法直接通信。 首部长度

    2022年8月3日
    8
  • createJs继承

    createJs继承下面是一个继承的例子 varcls nbsp nbsp nbsp nbsp nbsp nbsp function nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp functionMap nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp varthan this nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp this Container constructor 相当于 as3this super nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp this name

    2026年3月26日
    3
  • bitr函数_函数表达式

    bitr函数_函数表达式一、BitBlt函数的作用:该函数对指定的源设备环境中的像素进行位块转换,以传送到目标设备环境。二、BitBlt函数原型:boolBitBlt(HDChdcDest,//指向目标设备环境的句柄int  nXDest,//指定目标矩形区域坐上角的X轴逻辑坐标int  nYDest,//指定目标矩形区域左上角的Y轴逻辑坐标

    2022年10月19日
    5
  • 为什么说中国必须建设本土存储产业

    为什么说中国必须建设本土存储产业

    2022年3月5日
    45
  • StackOverFlowError原因和解决办法

    StackOverFlowError原因和解决办法StackOverFlo 是常见的 JVM 错误之一 在此博客文章中 我们将研究线程堆栈的内部机制 可能触发 StackOverFlo 的原因以及解决此错误的潜在解决方案 为了更深入地了解 StackOverFlo 让我们回顾一下这个简单的程序 1publicclass 2 3publicstati Stringargs 4 5a 6

    2026年3月18日
    2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号