第一步:先到注册一个会员账号;
第二步:在test.php文件中插入代码:
<?php$cont="你好,这是我发的测试短信,祝你成功!";//短信内容$mynum="13971008888";//接受短信的手机$url=':6630/gb2312/web_api/?x_eid=0&x_uid=woxp会员账号&x_pwd_md5=MD5加密后的密码&x_ac=10&x_target_no='."$mynum".'&x_memo='."$cont".'&x_gate_id=300'; echo Get($url);function Get($url){if(function_exists('file_get_contents')){$file_contents = file_get_contents($url);}else{$ch = curl_init();$timeout = 5;curl_setopt ($ch, CURLOPT_URL, $url);curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);$file_contents = curl_exec($ch);curl_close($ch);}return $file_contents;}?>
第三步,浏览test.php,如果参数配置正确,则短信可成功到达预设手机号码上,完毕!
本文转载于九头鸟工作室:http://www.9-/news/tec/176.html