Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkGmail($username, $password)
- {
- $url = "https://mail.google.com/mail/feed/atom";
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($curl, CURLOPT_USERPWD, $username . ":" . $password);
- curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
- curl_setopt($curl, CURLOPT_ENCODING, "");
- $mailData = curl_exec($curl);
- curl_close($curl);
- return $mailData;
- }
- header('Content-Type:text/xml; charset=UTF-8');
- $feed = checkGmail("gmail", "password");
- echo $feed;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement