Jump to content

mail a php generated page


sheriff

Recommended Posts

Hi all ...

 

I ask if it's possible to sent to email a php generated page as an html attachment or text file !?

 

I have searched on google, but I find only how to send mail from php not hot to send a page.

 

Any link, or doc is helpfull !

 

The story:

I have a long products list, from where I select some items what I want to send as a price list to some people.

 

Thanks !

Link to comment
https://forums.phpfreaks.com/topic/45514-mail-a-php-generated-page/
Share on other sites

so ...

I resolved the problem.

 

 

 

// This save the php generated page to html file

$out1 = ob_get_contents();

ob_end_clean();

$fh = fopen('proce_list.html', "w");

fwrite($fh, $out1);

fclose($fh);

 

 

// The mailing part

$today = date('d-m-Y');

 

$headers = "From: [email protected] \r\n";

$headers.= "Content-Type: text/html; charset=ISO-8859-1 ";

$headers .= "MIME-Version: 1.0 ";

 

$attachment = chunk_split(file_get_contents('send.html'));

mail("[email protected]", "Offer - " . $today, $attachment, $headers);

 

 

I will make it with forms to be ease to write the recipient address.

 

if anyone have better idea ... I appreciate it :)

 

Thanks !

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.