Advertisement
FenTaylor

Untitled

Jan 16th, 2019
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. <?
  2. $mailuser="shop@site.su";
  3. $mailpass="password";
  4. $mailhost="{imap.yandex.ru:993/imap/ssl/novalidate-cert}INBOX";
  5. $mailbox = imap_open($mailhost,$mailuser,$mailpass) or die("<br />\nFAILLED! ".imap_last_error());
  6. $emails = imap_search($mailbox,'ALL');
  7. $output = '';
  8. rsort($emails);
  9.  
  10. $num = 0;
  11.  
  12. foreach($emails as $email_number) {
  13.     $num++;
  14.     $overview = imap_fetch_overview($mailbox,$email_number,0);
  15.         echo '<pre>';
  16.         var_dump($overview[0]);
  17.         echo '</pre>';
  18.     $decode_subj = mb_decode_mimeheader($overview[0]->subject);
  19.     $u_date = $overview[0]->udate;
  20.     if ($num==10) break;
  21. }
  22.  
  23. imap_close($mailbox);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement