File get content not working in php -


i using following code retrieve gmail inbox php, code not working. doing wrong ?

$urls = "https://mygmail@gmail.com:mypassword@gmail.google.com/mail/feed/atom/"; $filecontents = file_get_contents($urls);  print_r($filecontents); 

depending on php configuration, may easy using:

$urls="https://mygmail@gmail.com:mypassword@gmail.google.com/mail/feed/atom/"; $filecontents = file_get_contents($urls); 

however, if allow_url_fopen isn't enabled on system, read data via curl follows:

<?php     $ch= curl_init();     curl_setopt($ch, curlopt_url, $urls);     curl_setopt($ch, curlopt_binarytransfer, true);     curl_setopt($ch, curlopt_returntransfer, true);      $output = curl_exec($ch);     curl_close($curlsession);     echo $output; ?> 

Comments