GOSTRA_FX

PHP IMAP yandex

Feb 2nd, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?
  2. $mailuser="shop@stich.su";
  3. $mailpass="Ctljdf46f";
  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);
Add Comment
Please, Sign In to add comment