This is my code.
include("Mail.php");
include("Mail/mime.php");
$text = "";
$html = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<title></title>
<style type='text/css'>
#footer {0 0 repeat-x ; width:90%; font-family:'lucida grande',tahoma,verdana,arial,sans-serif; font-size:10px; text-transform:uppercase; padding:2px; }
</style>
</head>
<body>
<div align='center'>
$msg
</div>
</body>
</html>";
$crlf = "\r\n";
$hdrs = array(
"From" => $emailempresaprincipal->email,
"Subject" => $subj ,
"To" => "$to",
"Cc" => "$cc_",
"Bcc" => "bcc_"
);
$mime = new Mail_mime($crlf);
if ($ficheiro_){
foreach($_FILES['ficheiro_']['name'] as $key => $name) {
$tipo = substr($_FILES['ficheiro_']['type'][$key], 0, 5);
$dirmail = "c:/wamp/www/portal/documentacao/";
$dir = '../documentacao/';
$nomedocumento_ = date("Ymd") . date("His") . "-";
ficheiros ="$dir". $_FILES['ficheiro_']['name'][$key];
$mime->addAttachment($dirmail . $nomedocumento_ . $_FILES['ficheiro_']['name'][$key]);
}
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$recipients = $to.", ".$cc . ", ". $bcc_;
$mail =& Mail::factory("smtp");
$mail->send($recipients , $hdrs, $body);