Bug #10031 [NEW]: sending emails with hmtl body doesn't work
| From: | yvettesio at yahoo dot com | Date: | Tue, 06 Feb 2007 01:54:31 +0000 |
| Subject: | Bug #10031 [NEW]: sending emails with hmtl body doesn't work | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-9399@lists.php.net to get a copy of this message | ||
From: yvettesio at yahoo dot com
Operating system: windows XP
Package version:
PHP version: 4.4.2
Package: Documentation
Bug Type: Bug
Bug description: sending emails with hmtl body doesn't work
Description:
------------
Hi I am using PEAR 1.4.11 package i tried using mail mime class to send
html messages to emails but it didn't work
Test script:
---------------
<?php
if($_POST['send']){
include($lib_dir.'PEAR/Mail.php');
include($lib_dir.'PEAR/Mail/mime.php');
$html = '<html><body>HTML version of email</body></html>';
$crlf = "\n";
$hdrs = array(
'From' => $_POST['y_email'],
'Subject' => 'Check this Site'
);
$mime = new Mail_mime($crlf);
$mime->setHTMLBody($html);
//do not ever try to call these lines in reverse order
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('mail');
$mail->send($_POST['f_email'], $hdrs, $body);
}
include $theme_dir."theme_email_friend.php";
?>
Expected result:
----------------
it should have been sent through my email
Actual result:
--------------
it printed the html code and stop running the rest of the script. it
shouldn't have been printed but send to the email address immediately
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=10031&edit=1
--