Mailing HTML content with PHP -
i mail content of web page looks like:
<html> <body> <?php function sendpagecontenttoemail($destemail) { ob_start(); $buffer = ob_get_contents(); ob_end_clean(); $subject = 'subject name'; mail($destemail, $subject, $buffer); } ?> <div style="width:400px; margin:0 auto;"> <p> name: <?php print($customerdata['customer_name']); ?> </p> <p> .... </p> </div> </body> </html> <?php sendpagecontenttoemail($customerdata['customer_email']); //erase temp data session_destroy(); ?>
$buffer empty (ob_get_content()) regardless of sendpagecontenttoemail() called. should function called (assuming right way it)?
what ob_start start caching output, so, if output before calling it, part won't cached.
just @ start, before <html>
<?php ob_start(); ?>
Comments
Post a Comment