hi truppe,
here's some code that works for me.
i also have to exchange \n with \r\n  in zend_mime Mime.php, otherwise
theres an ZF error.
 mike



        public function send_mail($subject, $path)
        {
                
$html = <<<EOT
<html><body>
<p> a.gif </p>
<p> b.gif </p>
<p> c.gif </p>
<p> d.gif </p>
<p> e.gif </p>
</body></html>
EOT;

        $tr = new Zend_Mail_Transport_Smtp('smpt.xxxx.com');
        Zend_Mail::setDefaultTransport($tr);
        
        $mail = new Zend_Mail();
        $mail->setFrom          ('[EMAIL PROTECTED]', 'xxxx');
        $mail->addTo            ('[EMAIL PROTECTED]', 'yyyyy');
        $mail->setSubject       ($subject);

        $mail->setBodyHtml($html, null, Zend_Mime::ENCODING_7BIT);

        
        $a      = file_get_contents( $path . "/a.gif");
        $b      = file_get_contents( $path . "/b.gif");
        $c      = file_get_contents( $path . "/c.gif");
        $d      = file_get_contents( $path . "/d.gif");
        $e      = file_get_contents( $path . "/e.gif"); 
        
        // !!!! in zend_mime Mime.php exchange \n with \r\n  - strange ZF bug
        $att = $mail->createAttachment($a);     $att->type = 'image/gif';
$att->filename = 'a.gif';
        $att = $mail->createAttachment($b);     $att->type = 'image/gif';
$att->filename = 'b.gif';
        $att = $mail->createAttachment($c);     $att->type = 'image/gif';
$att->filename = 'c.gif';
        $att = $mail->createAttachment($d);     $att->type = 'image/gif';
$att->filename = 'd.gif';
        $att = $mail->createAttachment($e);     $att->type = 'image/gif';
$att->filename = 'e.gif';

        $mail->send();  
        }




Truppe Steven wrote:
> 
> Hi,
> 
> i have the requirement to send html emails that contains images (that
> are shown insdie the html text, not as attachment) for the shop of my
> customer.
> 
> Is there a simple solution for this ?
> 
> best regards,
> Truppe Steven
> 
> 

-- 
View this message in context: 
http://www.nabble.com/how-to-show-images-inside-a-html-Zend_Mail---tf4364751s16154.html#a12447610
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to