I have PHP file for make table with data row from database . I want send this page to email . but when I get content contains HTML and PHP code . but I want send only result of page in HTML.
i use this code
$str = file_get_contents( 'template.php' );
$mail = "[email protected]";
mail($mail,$str);
and this
$str = readfile("'template.php'");
but result contains php code in email . how i can get only html result?
'/path/to/template.php'instead of/path/to/template.php? Skip the apostrophes! You can get the content of a PHP file by using output buffers and one of theinclude/requirefunctions.