MIME Messages
<?php
require_once HORDE_BASE . '/lib/MIME/Message.php'; require_once HORDE_BASE . '/lib/MIME/Part.php';
// Create a MIME message $message = new MIME_Message();
// Create a message body $bodyPart = new MIME_Part('text/plain', 'message contents');
// Add attachments (MIME_Part objects) to it $message->addPart($bodyPart); $message->addPart($attachment1);
// Generate the full message body. It still needs headers. $generated = $message->toString();
?>
- The MIME_Message class lets you easily generate a message made up of MIME_Part objects
- MIME_Part objects known their mimetype, can generate the necessary headers, and correspond to individual attachments.
|