Comunitatea PHP Romania
 

 
Tutorial

Tutorial

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.

<?php
require_once 'Mail/Mbox.php';
$mbox = new Mail_Mbox('/path/to/mbox');
$mbox->open();
//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:

<?php
//... 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.

<?php
//... other code
$mbox->close();
?>

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

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
la birou
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
mihaitha mihaitha
Sibiu
Mascka Mascka
Braila
gabysolomon gabysolomon
Bacau
whooper whooper
Toronto ON
raul_ raul_
dechim dechim
Drobeta Turnu Severin
Amenthes Amenthes

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Debt Consolidation | Myspace Layouts | Buy Anything On eBay | Debt Help | Mobile Phone deals
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis