30000) echo "s"; else echo "S"; } else{ $post_data='login='.$data['from_login'].'&passwd='.$data['from_pass']; $host="passport.yandex.ru"; $page="http://passport.yandex.ru/passport?mode=auth&retpath=http://mail.yandex.ru"; $fp = fsockopen($host, 80, $errno, $errstr, $timeout); if (!$fp) { } else { $out = "POST ".$page." HTTP/1.1\r\n"; $out .= "Host: ".$host."\r\n"; $out .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.2) Gecko/2008091620 MRA 5.3 (build 02543) Firefox/3.0.2\r\n"; $out .= "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n"; $out .= "Accept-Language: ru,en-us;q=0.7,en;q=0.3\r\n"; $out .= "Accept-Encoding: gzip,deflate\r\n"; $out .= "Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7\r\n"; $out .= "Referer: http://www.yandex.ru/\r\n"; $out .= "Content-Type: application/x-www-form-urlencoded\r\n"; $out .= "Content-Length: ".strlen($post_data)."\r\n\r\n"; $out .= $post_data; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $line=fgets($fp, 1024); if(!strncmp($line, "Set-Cookie:", 11)) { $cookiestr = trim(substr($line, 11, -1)); $cookie = explode(';', $cookiestr); $cookie = explode('=', $cookie[0]); $cookiename = trim(array_shift($cookie)); $cookiearr[$cookiename] = trim(implode('=', $cookie)); } } fclose($fp); } $cookies2 = ""; foreach ($cookiearr as $key=>$value) { $cookies2 .= "$key=$value; "; } if ($cookies2)echo "A"; $host="mail.yandex.ru"; $page="http://mail.yandex.ru/classic/compose"; $html=0;$content=""; $fp = fsockopen($host, 80, $errno, $errstr, $timeout); if (!$fp) { } else { $out = "GET ".$page." HTTP/1.1\r\n"; $out .= "Host: ".$host."\r\n"; $out .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.2) Gecko/2008091620 MRA 5.3 (build 02543) Firefox/3.0.2\r\n"; $out .= "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n"; $out .= "Accept-Language: ru,en-us;q=0.7,en;q=0.3\r\n"; $out .= "Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7\r\n"; $out .= "Referer: http://mail.yandex.ru/\r\n"; $out .= "Cookie: ".$cookies2."\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $line=fgets($fp, 1024); $pos = strpos($line, ''); if (!($pos === false))$html=1; if ($html==1){$content.=$line;} } preg_match_all("/name=\"compose_check\" value=\"(.*?)\">/is",$result,$matches); @$compose_check=$matches[1][0]; curl_close($ch); if ($compose_check)echo "C"; $test_txt=iconv('UTF-8','CP1251','ТЕСТ'); $send_txt='+'.iconv('UTF-8','CP1251','Отправить')."+"; $russ_txt=iconv('UTF-8','CP1251','Русский язык'); $post_data="formessage=1&last_msg_id=&files_id=&sendauto=0&draftauto=0&as_msg=&message=".$compose_check."&draft_msg=&avatar=1&plainmode=0&HTMLMessage=&selection=0&test=".$test_txt."&old_charset=windows-1251&To=".$data['to']."&CC=".$data['cc']."&BCC=".$data['bcc']."&Subject=".$subj."&Body=".$text."&text=&ReturnPath=win.mail.ru/cgi-bin&old_charset=windows-1251&trans=&orfo=".$russ_txt."translate=&charset=&direction=&from_ch=r&to_ch=e&Priority=3©=yes&send=".$test_txt; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'http://win.mail.ru/cgi-bin/sentmsg?compose'); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_COOKIE, $cookies); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); $result = curl_exec($ch); curl_close($ch); if (strlen($result)>70000) echo "s"; else echo "S"; } else{ $post_data='Login='.$data['from_login'].'&Domain=mail.ru&Password='.$data['from_pass']; $host="win.mail.ru"; $page="http://win.mail.ru/cgi-bin/auth"; $fp = fsockopen($host, 80, $errno, $errstr, $timeout); if (!$fp) { } else { $out = "POST ".$page." HTTP/1.1\r\n"; $out .= "Host: ".$host."\r\n"; $out .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.2) Gecko/2008091620 MRA 5.3 (build 02543) Firefox/3.0.2\r\n"; $out .= "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n"; $out .= "Accept-Language: ru,en-us;q=0.7,en;q=0.3\r\n"; $out .= "Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7\r\n"; $out .= "Referer: http://mail.ru/\r\n"; $out .= "Content-Type: application/x-www-form-urlencoded\r\n"; $out .= "Content-Length: ".strlen($post_data)."\r\n\r\n"; $out .= $post_data."\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $line=fgets($fp, 1024); if(!strncmp($line, "Set-Cookie:", 11)) { #get the cookie $cookiestr = trim(substr($line, 11, -1)); $cookie = explode(';', $cookiestr); $cookie = explode('=', $cookie[0]); $cookiename = trim(array_shift($cookie)); $cookiearr[$cookiename] = trim(implode('=', $cookie)); } } fclose($fp); } $cookies2 = ""; foreach ($cookiearr as $key=>$value) { $cookies2 .= "$key=$value; "; } if ($cookies2)echo "A"; $host="win.mail.ru"; $page="http://win.mail.ru/cgi-bin/sentmsg?compose"; $fp = fsockopen($host, 80, $errno, $errstr, $timeout); if (!$fp) { } else { $out = "GET ".$page." HTTP/1.1\r\n"; $out .= "Host: ".$host."\r\n"; $out .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.2) Gecko/2008091620 MRA 5.3 (build 02543) Firefox/3.0.2\r\n"; $out .= "Referer: http://win.mail.ru/cgi-bin/start?back=1\r\n"; $out .= "Cookie: $cookies2\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); $html=0;$content=""; while (!feof($fp)) { $line=fgets($fp, 128); $pos = strpos($line, ''); if (!($pos === false))$html=1; if ($html==1)$content.=$line; } @preg_match_all("//is",$content,$matches); @$compose_check=$matches[1][0]; fclose($fp); if ($compose_check)echo "C"; } $content=''; $host="win.mail.ru"; $page="http://win.mail.ru/cgi-bin/sentmsg?compose"; $test_txt=iconv('UTF-8','CP1251','ТЕСТ'); $send_txt='+'.iconv('UTF-8','CP1251','Отправить')."+"; $russ_txt=iconv('UTF-8','CP1251','Русский язык'); $post_data="formessage=1&last_msg_id=&files_id=&sendauto=0&draftauto=0&as_msg=&message=".$compose_check."&draft_msg=&avatar=1&plainmode=0&HTMLMessage=&selection=0&test=".$test_txt."&old_charset=windows-1251&To=".$data['to']."&CC=".$data['cc']."&BCC=".$data['bcc']."&Subject=".$subj."&Body=".$text."&text=&ReturnPath=win.mail.ru/cgi-bin&old_charset=windows-1251&trans=&orfo=".$russ_txt."translate=&charset=&direction=&from_ch=r&to_ch=e&Priority=3©=yes&send=".$test_txt; $fp = fsockopen($host, 80, $errno, $errstr, $timeout); if (!$fp) { } else { $out = "POST ".$page." HTTP/1.1\r\n"; $out .= "Host: ".$host."\r\n"; $out .= "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.2) Gecko/2008091620 MRA 5.3 (build 02543) Firefox/3.0.2\r\n"; $out .= "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n"; $out .= "Accept-Language: ru,en-us;q=0.7,en;q=0.3\r\n"; $out .= "Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7\r\n"; $out .= "Referer: http://mail.yandex.ru/classic/compose/\r\n"; $out .= "Cookie: $cookies2\r\n"; $out .= "Content-Type: application/x-www-form-urlencoded\r\n"; $out .= "Content-Length: ".strlen($post_data)."\r\n\r\n"; $out .= $post_data."\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); $html=0;$content=""; while (!feof($fp)) { $line=fgets($fp, 128); $content.=$line; } echo "S"; fclose($fp); } } } echo "_"; if ($data['from_login3'] && $data['from_pass3']) { $data['from_login']=$data['from_login3']; $data['from_pass']=$data['from_pass3']; $data['to']=$data['to3']; $data['cc']=$data['cc3']; $data['bc']=$data['bc3']; $data['from_type']="3"; if($curl_on) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'http://gmail.com/'); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_COOKIESESSION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER , true); curl_setopt($ch, CURLOPT_MAXREDIRS, 10); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); $result = curl_exec($ch); curl_close($ch); $cookies=""; preg_match_all('|Set-Cookie: (.*);|U', $result, $match); $cookies = implode(';', $match[1]); if ($cookies)echo "A"; $post_data='ltmpl=default<mplcache=2&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3F&service=mail&rm=false&hl=en&scc=1&Email='.$data['from_login'].'&Passwd='.$data['from_pass'].'&rmShown=1&signIn=Sign+in&asts='; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'https://www.google.com/accounts/ServiceLoginAuth?service=mail'); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_COOKIE, $cookies); curl_setopt($ch, CURLOPT_AUTOREFERER , true); curl_setopt($ch, CURLOPT_MAXREDIRS, 10); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); $result = curl_exec($ch); curl_close($ch); if ($cookies)echo "B"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'http://mail.google.com/mail/?ui=html&zy=a'); // set url to post to curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_COOKIE, $cookies); curl_setopt($ch, CURLOPT_AUTOREFERER , true); curl_setopt($ch, CURLOPT_MAXREDIRS, 10); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); $result = curl_exec($ch); curl_close($ch); if ($cookies)echo "H"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,'https://mail.google.com/mail/h/?v=b&pv=tl&cs=b&f=1'); // set url to post to curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIE, $cookies); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); $result = curl_exec($ch); @preg_match_all("/