Problem with Mail/mime.php
| From: | Bigarelli Giordano | Date: | Mon, 08 Jul 2002 07:55:08 +0000 |
| Subject: | Problem with Mail/mime.php | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-1815@lists.php.net to get a copy of this message | ||
Hi, I've used the following code to send email with attachment from a web
page, all works fine but the content of the email is not always the same.
For example sometimes the email that arrives is correct, but more frequently
(to different people using microsoft outlook) parts of the header are
visible in the body with an unreadable attachment.
$hdrs = array('From' => 'sender@a-domain.com', 'Subject' =>
"$titolo",
"Reply-To" => 'sender@a-domain.com');
$mime = new Mail_mime("\r\n");
$mime->setTXTBody($text);
$mime->setHTMLBody($text);
$mime->addAttachment($HTTP_POST_FILES['file']['tmp_name'],
$HTTP_POST_FILES['file']['type'],
$HTTP_POST_FILES['file']['name']);
$m_body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('mail');
$mail->send('receiver@a-domain.com', $hdrs, $m_body);
How can I solve the problem?
Thanx
Bigarelli Giordano