Displaying contents of processed PHP page as body in E-Mail

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

Guest
Hello guys,

:help:

I do need help. I had been looking for something where I could find how to attach a processed PHP page into the body part of the email but couldn't find one. I have a PHP page which displays the results of a certain query. I wish to include that whole PHP page (including images on that page) into the mail. Is it possible that when the email is sent it processes the page before actually including it or it has to be generated before it could be included?

Already thanks!

gb
 
Thanks Guys!

I actually was able to send the whole page. All I did was to open that file with fopen while passing the variable into it and it worked out perfectly. Here is the code-

Code:
<?php
	$e_mail_subject = "something";
	
	$handle = fopen ("http://www.someabsolutefilename?variablename=$variablevalue", "r"); 
	while (!feof ($handle)) { 
		$buffer = fgets($handle, 4096); 
		$reply .= $buffer; 
	} 
	fclose ($handle); 

	$mime_boundary = "<<<--GB--" . rand(10000,32000) . "-" . rand(10000,32000) . "--BG-->>>";
	
	$headers .= "From: $call_employee <$call_emp_email>\r\n"; 
	$headers .= "To: $v_call_contact <$v_call_email>\r\n"; 
	$headers .= "Bcc: $call_employee <$call_emp_email>, AnotherOne <another email>\r\n";

	$headers .= "MIME-Version: 1.0\r\n";
	$headers .= "Content-Type: multipart/mixed;\r\n";
	$headers .= " boundary=\"".$mime_boundary."\"";

	$message .= "This is a multi-part message in MIME format.\r\n";
	$message .= "\r\n";
	$message .= "--".$mime_boundary."\r\n";

	$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";
	$message .= "Content-Transfer-Encoding: 7bit\r\n";
	$message .= "\r\n";

	$message .= $reply;

	$message .= "\r\n";
	$message .= "--".$mime_boundary."\r\n";

?>
And that's it, using the simple mail() function of PHP it went on!!!

Enjoy!

GB
 
Back
Top