Mail Namespace Reference

o------------------------------------------------------------------------------o | This package is licensed under the Phpguru license. More...


Detailed Description

o------------------------------------------------------------------------------o | This package is licensed under the Phpguru license.

A quick summary is | | that for commercial use, there is a small one-time licensing fee to pay. For | | registered charities and educational institutes there is a reduced license | | fee available. You can read more at: | | | | http://www.phpguru.org/static/license.html | o------------------------------------------------------------------------------o

© Copyright 2008,2009 Richard Heyes Raw mime encoding class

What is it? This class enables you to manipulate and build a mime email from the ground up.

Why use this instead of mime.php? mime.php is a userfriendly api to this class for people who aren't interested in the internals of mime mail. This class however allows full control over the email.

Eg.

// Since multipart/mixed has no real body, (the body is // the subpart), we set the body argument to blank.

$params['content_type'] = 'multipart/mixed'; $email = new Mail_mimePart('', $params);

// Here we add a text part to the multipart we have // already. Assume $body contains plain text.

$params['content_type'] = 'text/plain'; $params['encoding'] = '7bit'; $text = $email->addSubPart($body, $params);

// Now add an attachment. Assume $attach is the contents of the attachment

$params['content_type'] = 'application/zip'; $params['encoding'] = 'base64'; $params['disposition'] = 'attachment'; $params['dfilename'] = 'example.zip'; $attach =& $email->addSubPart($body, $params);

// Now build the email. Note that the encode // function returns an associative array containing two // elements, body and headers. You will need to add extra // headers, (eg. Mime-Version) before sending.

$email = $message->encode(); $email['headers'][] = 'Mime-Version: 1.0';

Further examples are available at http://www.phpguru.org

TODO:

Author:
Richard Heyes <richard@phpguru.org>
Version:
Revision
1.3


Generated on Wed May 6 23:10:50 2009 for fareofficelib by  doxygen 1.5.8