| 
<?php
/*
 *    Sending text e-mail
 */
 $text = new lib_mail;
 
 //add sender's data
 $text->sender('[email protected]', 'My name is');
 
 //who should get the message
 $text->addTo('[email protected]');
 
 //subject
 $text->subject('test lib_mail');
 
 //text body.
 //the "true" parameters tells class to append text to the message body
 $text->text('===================='."\n", true);
 $text->text('= just   = like a  ='."\n", true);
 $text->text('= text   = based   ='."\n", true);
 $text->text('= table  = rows    ='."\n", true);
 $text->text('===================='."\n", true);
 
 //finally send the message
 $text->send();
 
 
 /*
 *    Sending html e-mail with CC and BCC
 */
 $html = new lib_mail;
 
 //add sender's data
 $html->sender('[email protected]', 'My name is');
 
 //who should get the message
 $html->addTo('[email protected]');
 
 //coppies
 $html->addCc('[email protected]', 'Display name');
 $html->addCc('[email protected]');
 
 //blind
 $html->addBcc('[email protected]', 'Hidden copy name');
 
 //subject
 $html->subject('test html lib_mail');
 
 //html body.
 //the "true" parameters tells class to append text to the message body
 $html->html('<table border="1">', true);
 $html->html('<tr><td>just</td><td>a</td></tr>', true);
 $html->html('<tr><td>html</td><td>based</td></tr>', true);
 $html->html('<tr><td>table</td><td>rows</td></tr>', true);
 $html->html('</table>', true);
 
 //send
 $html->send();
 
 
 /*
 *    Sending text+html e-mail
 */
 $ht = new lib_mail;
 
 //add sender's data
 $ht->sender('[email protected]', 'My name is');
 
 //who should get the message
 $ht->addTo('[email protected]');
 
 //subject
 $ht->subject('test text+html lib_mail');
 
 //text body.
 //the "true" parameters tells class to append text to the message body
 $ht->text('===================='."\n", true);
 $ht->text('= just   = like a  ='."\n", true);
 $ht->text('= text   = based   ='."\n", true);
 $ht->text('= table  = rows    ='."\n", true);
 $ht->text('===================='."\n", true);
 
 //html body.
 //the "true" parameters tells class to append text to the message body
 $ht->html('<table border="1">', true);
 $ht->html('<tr><td>just</td><td>a</td></tr>', true);
 $ht->html('<tr><td>html</td><td>based</td></tr>', true);
 $ht->html('<tr><td>table</td><td>rows</td></tr>', true);
 $ht->html('</table>', true);
 
 //send
 $ht->send();
 
 |