Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. function checkGmail($username, $password)
  2. {
  3. $url = "https://mail.google.com/mail/feed/atom";
  4.  
  5. $curl = curl_init();
  6. curl_setopt($curl, CURLOPT_URL, $url);
  7. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  8. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  9. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  10. curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password);
  11. curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  12. curl_setopt($curl, CURLOPT_ENCODING, "");
  13. $mailData = curl_exec($curl);
  14. curl_close($curl);
  15.  
  16. return $mailData;
  17. }
  18.  
  19. header('Content-Type:text/xml; charset=UTF-8');
  20. $feed = checkGmail("gmail", "password");
  21. echo $feed;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement