sheriff Posted April 4, 2007 Share Posted April 4, 2007 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 More sharing options...
joquius Posted April 4, 2007 Share Posted April 4, 2007 http://www.php.net/mail lots of solutions here. Link to comment https://forums.phpfreaks.com/topic/45514-mail-a-php-generated-page/#findComment-220997 Share on other sites More sharing options...
jitesh Posted April 4, 2007 Share Posted April 4, 2007 <?php // mail contents ob_start(); echo "Price1 ".$price1; echo "Price2 ".$price2; echo "Price3 ".$price3; $contents = ob_get_clean(); mail('.....','.....',$contents,'.....'); ?> Link to comment https://forums.phpfreaks.com/topic/45514-mail-a-php-generated-page/#findComment-220999 Share on other sites More sharing options...
sheriff Posted April 4, 2007 Author Share Posted April 4, 2007 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 ! Link to comment https://forums.phpfreaks.com/topic/45514-mail-a-php-generated-page/#findComment-221007 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.