Problem with mime.php
| From: | Bigarelli Giordano | Date: | Thu, 07 Mar 2002 16:51:38 +0000 |
| Subject: | Problem with mime.php | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-940@lists.php.net to get a copy of this message | ||
I want to send and e-mail with both text/plain and text/html body with an image embed on the
text/html part. I've read the documentation and I have used the following code... but the
image is attached and not embeded... What's wrong?
$text = 'Text version of email';
$html = '<html><body><B>HTML version of
email</B><BR><BR><IMG
SRC=\"opt1.gif\"></body></html>';
$mime = new Mail_mime("\r\n");
$mime->setTXTBody($text);
$mime->addHTMLImage("/home/funland.it/www/img/main/opt1.gif");
$mime->setHTMLBody($html);
$body = $mime->get();
$hdrs = $mime->headers(array('From' => 'Example From
<supporto@funland.it>', 'Subject' => 'A subject'));
$mail =& Mail::factory('mail');
$mail->send($this->email, $hdrs, $body);
Best Regards
Bigarelli Giordano