Esempio n. 1
0
                $part_body = str_ireplace('</body>', $part_footer . '</body>', $part_body);
            } else {
                $part_body .= $part_footer;
            }
            $mime->setHTMLBody($part_body);
            break;
            //case 'image':
            //  break;
            //case 'attachment':
            //  break;
    }
}
$body = $mime->get();
// Prepare headers
foreach ($headers as $name => $value) {
    $headers[$name] = $mime->encodeHeader($name, $value, 'utf-8', 'quoted-printable');
}
$headers = $mime->headers($headers);
//var_dump($headers);
// Create mailer instance
$mail =& Mail::factory($backend, $params);
// Sending email
$status = $mail->send($rcpts, $headers, $body);
if (PEAR::isError($status)) {
    // FIXME error should go into $notify_status
    print_message('%rMailer Error%n: ' . $status->getMessage(), 'color');
    $notify_status['success'] = FALSE;
} else {
    $notify_status['success'] = TRUE;
}
unset($message);