Bug #10031 [Opn->Fbk]: sending emails with hmtl body doesn't work
| From: | mj@php.net | Date: | Wed, 14 Feb 2007 09:46:35 +0000 |
| Subject: | Bug #10031 [Opn->Fbk]: sending emails with hmtl body doesn't work | ||
| References: | 1 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-9436@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=10031&edit=1
ID: 10031
Updated by: mj@php.net
Reported By: yvettesio at yahoo dot com
-Status: Open
+Status: Feedback
Type: Bug
Package: Documentation
Operating System: windows XP
PHP Version: 4.4.2
New Comment:
Setting state to "Feedback".
Previous Comments:
------------------------------------------------------------------------
[2007-02-05 20:59:53] davidc at php dot net
let me guess, this script prints the email that was suposed to be
sent..
include $theme_dir."theme_email_friend.php";
Also try this :
$sent = $mail->send(...);
if (PEAR::isError($sent)) {
print_r($sent);
die();
}
------------------------------------------------------------------------
[2007-02-05 20:54:30] yvettesio at yahoo dot com
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 this bug report at http://pear.php.net/bugs/bug.php?id=10031&edit=1