View Single Post
Old 11-03-2008, 11:41 PM  
Varius
Confirmed User
 
Industry Role:
Join Date: Jun 2004
Location: New York, NY
Posts: 6,890
You should start using PEAR, it's great for all kinds of things

Example:

PHP Code:
<?php
include('Mail.php');
include(
'Mail/mime.php');

$text 'Text version of email';
$html '<html><body>HTML version of email</body></html>';
$file1 './example.txt';
$file2 './example2.txt';
$crlf "\n";
$hdrs = array(
              
'From'    => '[email protected]',
              
'Subject' => 'Test mime message'
              
);

$mime = new Mail_mime($crlf);

$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$mime->addAttachment($file'text/plain');
$mime->addAttachment($file2'text/plain');

$body $mime->get();
$hdrs $mime->headers($hdrs);

$mail =& Mail::factory('mail');
$mail->send('postmaster@localhost'$hdrs$body);
?>
__________________
Skype variuscr - Email varius AT gmail
Varius is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote