PHP analog Gmail,hotmail (MSN), yahoo,163,126 mailbox Login (original), how to handle

Source: Internet
Author: User
Tags php source code
PHP analog Gmail,hotmail (MSN), yahoo,163,126 email Login (original)
have been busy recently, at the end of this 11 holiday, published this article, in order to let these sources open source

Of course these methods may not be desirable, but should be roughly the direction of the bar, due to the current do a uchome RTHK's site

We planned to change the friend invite inside the display way, at first I did not care, then said OK!

To get this time only found that the uch inside this place is to use the roaming type to do, let a person is no solution, what can not change!

Alas, since all agreed to say can, now the actual situation is not, so feel embarrassed, in order to solve this problem quickly, in Google,

Baidu on the search, the results and unexpectedly, on a 126 mailbox Open source example, the other is not, there is a cow brother left QQ said to other source code,

can add QQ buy! No comment on this person! I spent a bit of time, the whole, the result is lucky to get a few, because the time is limited, the current project has been working on the hand, so there is no other, now give Gmail,hotmail (MSN), Yahoo Mail contact PHP source code:



1.GMAIL
PHP Code
   
  /I ', $contents, $matches);                        if (!empty ($matches)) {$ $v = $matches [1];                    $matches = Array ();                }} $server = ' mail '; Preg_match ('/
  
   
  /I ', $contents, $matches);                    if (!empty ($matches)) {$GALX = $matches [1];                $matches = Array ();                                } $timeStmp = time ();                Step Two: Start login $ch = Curl_init ();                curl_setopt ($ch, Curlopt_ssl_verifypeer, false);                curl_setopt ($ch, Curlopt_url, "Https://www.google.com/accounts/ServiceLoginAuth");                 curl_setopt ($ch, Curlopt_cookiefile, Cookiejar);                curl_setopt ($ch, Curlopt_post, 1); $fileds = "dsh= $dsh &email=". $username. " &passwd={$password}&galx= $GALX &timestmp= $timeStmp &sectok= $secTok &signin=sign In&rmshown                 =1&asts=&persistentcookie=yes ";                 curl_setopt ($ch, Curlopt_postfields, $fileds);                              curl_setopt ($ch, Curlopt_cookiejar, Cookiejar);                curl_setopt ($ch, Curlopt_timeout, TIMEOUT); curl_setopt ($ch, Curlopt_Returntransfer, True);                               $str = curl_exec ($ch);                     Curl_close ($ch); The third step: check cookies are also considered as a guide page $ch = Curl_init ("Https://www.google.com/accounts/CheckCookie?chtml=LoginDoneHt                               ML ");                curl_setopt ($ch, Curlopt_ssl_verifypeer, false);                curl_setopt ($ch, Curlopt_returntransfer, true);                curl_setopt ($ch, Curlopt_cookiefile,cookiejar);                                 curl_setopt ($ch, Curlopt_cookiejar, Cookiejar);                     curl_setopt ($ch, Curlopt_timeout, TIMEOUT);                                 $str 2 = curl_exec ($ch);                                                                Curl_close ($ch);                if (Strpos ($contents, "safe exit")!== false) {return false;        } return TURE; }//Get mailbox Contacts-Address public function GetaddResslist ($username, $password) {if (! $this->login ($username, $password))                {return FALSE;                }//start to enter analog crawl $ch = Curl_init (); curl_setopt ($ch, Curlopt_url, "http://mail.google.com/mail/contacts/data/contacts?thumb=true&groups=true  &show=all&enums=true&psort=name&max=300&out=js&rf=&jsx=true ");                OUT=JS returns JSON data, not set back to XML data curl_setopt ($ch, Curlopt_cookiefile, Cookiejar);                /* This setting is required for returning XML data curl_setopt ($ch, Curlopt_httpheader, Array ("Content-type:application/xml")); $str = "
    
     
      pab:searchcontacts
       
       
        FN
        
       
        true
        
    
     
   
     
      user:getsign Atures
     
   
     
      pab:getallgroups
     
   ";                                curl_setopt ($ch, Curlopt_postfields, $STR);                                  */curl_setopt ($ch, Curlopt_post, 1);                curl_setopt ($ch, Curlopt_returntransfer, true);                curl_setopt ($ch, Curlopt_timeout, TIMEOUT);                $contents = curl_exec ($ch);                Curl_close ($ch);                Die ($contents);                Get mail list from the page information username && emailaddress/* for processing when returning XML data Preg_match_all ("/
  
   
     (. *) <\/string>/umsi", $contents, $names);                $users = Array ();                    foreach ($names [1] as $k = + $user) {//$user = Iconv ($user, ' utf-8 ', ' gb2312 ');                $users [$mails [1][$k]] = $user;                } if (! $users) {return ' You have no contacts in your mailbox '; } */$contents = substr ($contents, strlen (' while (true); &&&START&&&A                 MP; '),-strlen (' &&&END&&& ');        return $contents; }} $gamil = new GMAIL; $res = $gamil->getaddresslist ([email protected] ', ' 123456 '); Echo $res;? > 
    
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.