curl-users
gmail login
Date: Wed, 16 Jul 2008 12:11:06 +0530
login to gmail using this script..........................
+++++++++++++++++++++++++++++++
$username=username; //username
$password=password; //password for that user
$gacookie="";
$postdata="Email=$username&Passwd=$password&service=mail&rm=false<mplcache=2&itmpl=default&hl=en&continue=
https://mail.google.com/mail/?nsr=0&ui=html&zy=l";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL,"
https://www.google.com/accounts/ServiceLoginAuth?service=mail");
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT
5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $gacookie);
curl_setopt ($ch, CURLOPT_COOKIEFILE, $gacookie);
curl_setopt ($ch, CURLOPT_REFERER, '
https://mail.google.com/mail/?nsr=1&auth=DQAAAHoAAACy1eD0UAT31WKeVsU-MTE17okXAamkjSuAMA7ChWMkQyzIng3arK9nHhPl-0LjhMx1xKqh8HTMy1L-H5BHsNDxdkWscqpMJHhQjanY5jsJaoIlhMe9yLGhqDeeGHatPoHwLZvNtzUwww_Ivc8xexsN4F2rAOGkI7-Ob8eQdo96Sg&gausr=$username'
);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POST, 1);
$AskApache_result = curl_exec ($ch);
curl_close($ch);
echo $AskApache_result;
//unlink($gacookie);
exit;
++++++++++++++++++++++++++++++
-- thanks & regards Rajesh PS
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-07-16