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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -