I like pear.
<?
include('Mail.php');
include('Mail/mime.php');
$text = 'Text version of email';
$html = '<html><body>HTML version of email</body></html>';
$file = './files/example.zip';
$crlf = "rn";
$hdrs = array(
'From' => '[email protected]',
'To' => '[email protected]',
'Subject' => 'Test mime message'
);
$mime = new Mail_mime($crlf);
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$mime->addAttachment($file,'application/octet-stream');
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('mail', $params);
$mail->send('[email protected]', $hdrs, $body);
?>