~~~
// 获取验证码
public function getcode($phone,$code)
{
$curl = curl_init();
curl_setopt($curl,CURLOPT_URL,'https://api.mysubmail.com/message/xsend');
curl_setopt($curl,CURLOPT_HEADER,0);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl,CURLOPT_POST,1);
$data = [
'appid'=>'42908',
'to'=>$phone,
'project'=>'fef8j',
'vars'=>'{"code":'.$code.',"time":"60"}',
'signature'=>'525c1a87d5545da28d63aecf2c64fbc4',
];
curl_setopt($curl,CURLOPT_POSTFIELDS,$data);
$res = curl_exec($curl);
dump(curl_error($curl));
curl_close($curl);
dump($res);die;
}
~~~