hiiii

I want to send an email as HTML with a given inclding page

the script goes like this

<?
/* recipients */
$to  = "someone@somewhere.com";

/* subject */
$subject="The subject";

$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=windows-1256\r\n";
$headers .= "To: SSS. KSK <sss@ksk.com>\r\n";
$headers .= "From: My Web Site <webmaster@mysite.com>\r\n";

/* here i  want to include a html/php page rather than typing it again from an existing one */

$message="include(\"myincludeingpage.php\")";

mail($to, $subject, $message, $headers) or die("mail not functioned!");
echo "<h2>Thank you</h2><br>Thank you";
?>

The mail does Work, but the including page does not appear,
what i receive in the email is in the message:

include(\"myincludeingpage.php\") :eek: what to do about it ???

    If myincludepage.php is just HTML and no actual PHP (which might be the case based on what you've written), then [man]file_get_contents[/man] would be the function to use (you want to get the contents of the file, not just write a string with the name of the file in it!)

    If there is PHP processing involved in myincludepage.php, then you'll need to run the file and put the result into the message, not (again) just write a string with the name of the file in it. The easiest method would probably be to use ob_start() and related functions to capture the output of myincludepage.php and put it into a variable.

      thanks allot..

      actually i have a php file that to be included ..

      i will search on ob_start() function

      thanks once again

        Write a Reply...