Advertisement
Guest User

Untitled

a guest
Nov 30th, 2011
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1. $inbox = imap_open($hostname,$username,$password,NULL,1) or die('Cannot connect to Gmail: ' . print_r(imap_errors()));
  2. $emails = imap_search($inbox,'ALL');
  3. if($emails) {
  4.      $output = '';
  5.      rsort($emails);
  6.      foreach($emails as $email_number) {
  7.           $message = imap_fetchbody($inbox,$email_number,1);
  8.           $output.= $message;
  9.      }
  10.      echo $output . "\n";      
  11. }
  12.  
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement