您好,欢迎访问一九零五行业门户网

PHP模拟登陆163邮箱发邮件及获取通讯录列表邮箱

php模拟登陆163邮箱发邮件及获取通讯录列表邮箱 出处下载:http://www.chree.cn/server/20150289.html 演示:http://www.chree.cn/demo/163mail.php 无 ?phpheader(content-type: text/html; charset=utf-8); error_reporting(0);/** * 登陆 * $user 163用
php模拟登陆163邮箱发邮件及获取通讯录列表邮箱
出处下载:http://www.chree.cn/server/20150289.html
演示:http://www.chree.cn/demo/163mail.php
$user, 'password' => $pass, 'verifycookie' => 1, 'style' => -1, 'product' => 'mail163', 'seltype' => -1, 'secure' => 'on' ); $fields_string = ''; foreach($fields_post as $key => $value){ $fields_string .= $key . '=' . $value . '&'; } $fields_string = rtrim($fields_string , '&'); $headers = array( 'user-agent' => 'mozilla/5.0 (windows; u; windows nt 5.1; zh-cn; rv:1.9) gecko/2008052906 firefox/3.0', 'referer' => 'http://www.163.com' ); $ch = curl_init($url); curl_setopt($ch, curlopt_returntransfer, true);//返回结果存放在变量中,而不是默认的直接输出 curl_setopt($ch, curlopt_header, true); curl_setopt($ch, curlopt_connecttimeout, 120); curl_setopt($ch, curlopt_httpheader, $headers); curl_setopt($ch, curlopt_cookiejar, $cookie);//关闭连接时,将服务器端返回的cookie保存在以下文件中 curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, $fields_string); $result= curl_exec($ch); curl_close($ch); preg_match_all('/(.*?) /i', $result,$infos,preg_set_order); if(!empty($infos['0']['1'])){ unlink($cookie); exit(''); }else{ $g_root = dirname(__file__); file_put_contents($g_root.'/cache/cookie', $cookie); return $cookie; } } /** * * $data['url'] 请求地址 * $data['data_post'] post数据 * $data['cookie'] * **/ function curl($data){ $url = $data['url']; $data_post= $data['data_post']? $data['data_post']: false; $cookie = $data['cookie']; $headers = array( 'user-agent' => 'mozilla/5.0 (windows; u; windows nt 5.1; zh-cn; rv:1.9) gecko/2008052906 firefox/3.0', 'referer' => 'http://www.163.com' ); $ch = curl_init($url); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_header, true); curl_setopt($ch, curlopt_connecttimeout, 120); curl_setopt($ch, curlopt_httpheader, $headers); curl_setopt($ch, curlopt_cookiejar, $cookie); curl_setopt($ch, curlopt_cookiefile, $cookie); //cookie文件 登陆之后 //post 提交 if($data_post){ curl_setopt($ch, curlopt_post, 1); curl_setopt($ch, curlopt_postfields, $data_post); } $result = curl_exec($ch); curl_close($ch); return $result; }
其它类似信息

推荐信息