<?php

        error_reporting(E_ALL);

        include('includes/class.html.mime.mail.php');





        $img = array(1=>"espaco.gif",

                        "w.gif",

                        "b.gif");



        $imagem = array();



        for(reset($img); $key=key($img); next($img))

        {

        $value = pos($img);



        $filename = "$path/mail/$value";





        if ($os == "windows")

           {

        $imagem[$key] = fread($fp = fopen($filename, 'rb'), filesize($filename));

           }

        else

           {

        $imagem[$key] = fread($fp = fopen($filename, 'r'), filesize($filename));

           }



        fclose($fp);



        }                                           



        $mail = new html_mime_mail("X-Mailer: Html Mime Mail Class\n");

	$html = $buf;

        $text = 'Segue seu boleto bancario';

        for(reset($img); $key=key($img); next($img))

        {

        $value = pos($img);



        $mail->add_html_image($imagem[$key], $value, 'image/gif');



        }



        $mail->add_html($html, $text);

        $mail->body = '';

        $mail->build_message();





        if ($os == "windows")

           {



        include('includes/class.smtp.inc');

        $smtp = new smtp_class;



        $smtp->host_name = "$mailserver";                       // Endereco do servidor de email

        $smtp->localhost = "$webserver";                        // emdereco da maquina local:



        $from    = $mailfrom;

        $to      = array("$email");                             // Pode ter mais que um endereco de email

        $headers = array("To: \"$sacado\" <$email>");



        $mail->smtp_send('smtp', $from, $to, $subject, $headers);



          }

        else

          {





        $mail->send($sacado, $email, $namefrom, $mailfrom, $subject);



          }                                                            







?>

