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

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -