PHP analog Gmail,hotmail (MSN), yahoo,163,126 email Login (original)
This post was last edited by hudie631489527 on 2010-10-07 23:18:31
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
Define ("Cookiejar", Tempnam (Ini_get ("Upload_tmp_dir"), "Cookie")); Define the path where cookies are stored and have permission to operate.
Define ("TIMEOUT", 1000); Timeout settings
Class GMAIL
{
Private Function Login ($username, $password)
{
The first step: simulate crawling data on the login page and note the cookies
$cookies = Array ();
$matches = Array ();
Get form
$login _url = "Https://www.google.com/accounts/ServiceLoginAuth";
$ch = Curl_init ($login _url);
curl_setopt ($ch, Curlopt_ssl_verifypeer, false);
curl_setopt ($ch, Curlopt_cookiejar, Cookiejar);
curl_setopt ($ch, Curlopt_returntransfer, 1);
$contents = curl_exec ($ch);
Curl_close ($ch);
Simulation parameters
$name = Array (' DSH ', ' timestmp ', ' Sectok ');
foreach ($name as $v) {
Preg_match ('/
/I ', $contents, $matches);
if (!empty ($matches)) {
$ $v = $matches [1];
$matches = Array ();
}