Location: PHPKode > scripts > XS PHP Library > xs-php-library/src/mime.php
<?php
//
// +--------------------------------------------------------------------------+
// |                                                                          |
// |                   XS PHP Library  Generic Classes Library                |
// |                                                                          |
// |                   Copyright (c) 2001-2002 XSPHPLib Group.                |
// |                                                                          |
// +--------------------------------------------------------------------------+
// |                                                                          |
// | Distributed under the terms of the GNU Lesser General Public License as  |
// | published by the Free Software Foundation version 2.1                    |
// | See the GNU Lesser General Public License for more details. You should   |
// | have received a copy of the GNU Lesser General Public License along with |
// | this package; if not, write to the Free Software Foundation, Inc.,       |
// | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.                 |
// |                                                                          |
// +--------------------------------------------------------------------------+
// |                                                                          |
// | Authors: Robert Bala <hide@address.com>                                   |
// |                                                                          |
// +--------------------------------------------------------------------------+
//
// $Id: mime.php,v 1.2 2002/11/28 09:51:38 rbala Exp $

include_once('../inc/object.inc.php');
include_once('../inc/mime.inc.php');

$entity = new MIME('multipart', 'mixed');

$subpart1 =& $entity->addMimePart('part1', 'text', 'plain');

$subpart1->setEncoding(MIME_ENCODING_7BIT);

$subpart1->setMimeParam('charset', 'iso-8859-1');
$subpart1->setContent('This is Subpart text message body....');
$subpart1->setDescription('Sample text message.');

$subpart2 =& $entity->addMimePart('part2', 'text', 'plain');

$subpart2->setEncoding(MIME_ENCODING_BASE64);

$subpart2->setMimeParam('filename', 'README');
$subpart2->setContent('../README');
$subpart2->setDescription('Sample attached file.');

$subpart2->setDisposition('attachment');

echo "<pre>\r\n";
echo $entity->mimeHeaders();
echo "\r\n";
echo $entity->mimeMessage();
echo "<pre>\r\n";

?>
Return current item: XS PHP Library