Hello everybody,
I would like to email a page after all php code in it is interpreted. In other words I want to email the final result, not the code. Does anyone have an idea how to do that?
I am using phpmailer.
Thanks in advance!
Maybe you could try the mail() function..?
You can use the output buffering functions to capture the result of the PHP code, and then use mail() to e-mail it. The mail() command can be in the same script as the code that will be interpreted.
Diego
My problem is not strictly related to mailing stuff. phpmailer does a great job with that. My problem is to send an interpreted php file. For example:
test.php: <?phpinfo()?>
If I mail this file, the person will receive exactly what the file contains. What I want is the person to receive the result of phpinfo().
Thanks for your help!
Hello Diego25,
Can you tell me what are the buffering functions you are referring to?
Thanks!
Okay, I got it thanks to Diego's tip!
[...]
ob_start(); include( "view_form.html" ); $page = ob_get_contents(); ob_end_clean(); $mail->Body = $page;
I think it's time I update my local copy of the php doc.
:rolleyes:
Case closed!