Mail_Mbox
[ class tree: Mail_Mbox ] [ index: Mail_Mbox ] [ all elements ]

Source for file read.php

Documentation is available at read.php

  1. <?php
  2. //read the subjects of the demo mailbox
  3.  
  4. require_once 'Mail/Mbox.php';
  5.  
  6. //reads a mbox file
  7. $file dirname(__FILE__'/demobox';
  8. echo 'Using file ' $file "\n";
  9.  
  10. $mbox = new Mail_Mbox($file);
  11. $mbox->open();
  12.  
  13. for ($n = 0; $n $mbox->size()$n++{
  14.     $message $mbox->get($n);
  15.     preg_match('/Subject: (.*)$/m'$message$matches);
  16.     $subject $matches[1];
  17.     echo 'Mail #' $n ': ' $subject "\n";
  18. }
  19.  
  20. $mbox->close();
  21. ?>

Documentation generated on Mon, 11 Mar 2019 15:35:10 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.