php调用云片网接口发送短信的实现方法
云片网发送短信
/**
* [SendSms description]
* @param [string] $tpl_content [发送的短信内容]
* @param $send_mobile [发送的手机号码]
*/
public function SendSms($tpl_content,$send_mobile)
{
$this->yunpian_appkey = env('yunpian_appkey');//云片账户appkey
$this->yunpian_secret = env('yunpianSecretXYZ');//云片账户secret
//初始化
$ch = curl_init();
$data=array('text'=>$tpl_content,'apikey'=>$this->yunpian_appkey,'mobile'=>$send_mobile);
curl_setopt ($ch, CURLOPT_URL, 'https://sms.y*unpi**an.com/v2/sms/single_send.json');
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept:text/plain;charset=utf-8', 'Content-Type:application/x-www-form-urlencoded', 'charset=utf-8'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$send_data = curl_exec($ch);
curl_close($ch);
//解析返回结果(json格式字符串)
$backmassage = json_decode($send_data,true);
echo '$backmassage ';
//这里是写在了job里面所以记了个日志可忽略!
Log::info('smsmessagelog: '.$send_data);
return [$backmassage,$send_data];
}
g沙盒仇恨官方英文版(gorebox)
G沙盒仇恨英文原版是一款最近非常火热的沙盒模拟类游戏,在这里
迷你世界测试服最新版2024
迷你世界测试服2021最新版,即迷你世界的先遣服版本,用户能
闪耀暖暖最新版2024
闪耀暖暖手游这是非常好玩的换装手游,游戏内容丰富有趣,游戏环
杜拉拉升职记官方正版
杜拉拉升职记手游完美还原了经典同名电视剧中的故事剧情、以及各
银河战舰手机版
银河战舰满你所想宇宙战舰世界,茫茫宇宙资源是一切,你必须利用