/**
* [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.yunpian.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];
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有