Tutorial – How to use Mail_Mbox

How to use Mail_Mbox

Before you can do anything with the mbox file, you need to create an instance of the Mail_Mbox class and open() it.

require_once 'Mail/Mbox.php';
$mbox = new Mail_Mbox('/path/to/mbox');
//do more here

After opening the file, you can retrieve single messages via get(). The size() method helps you to determine the number of messages:

//... initialisation
for ($n 0$n $mbox->size(); $n++) {
$message $mbox->get($n);
//do something with the message text

If you're done working with the file, close() it.

//... other code

Also have a look at the Mail_Mbox examples directory in /path/to/pear/docs/Mail_Mbox/examples/.

Klasa służąca do odczytu plików maili mbox. (Previous) Create a new Mbox class instance. (Next)
Last updated: Thu, 31 Jul 2014 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.