I have a PHP file for a make table with a row of data from a database. I want to send this page by email. but when I get the content, it contains HTML and PHP code. but I want to send only the result of the page in HTML.
I am using this code
$str = file_get_contents( 'template.php' );
$mail = "test@tst.com";
mail($mail,$str);
and this one
$str = readfile("'template.php'");
but the result contains php code in email. how can i get only html result?
source
share