Sorry Mark, What I meant is say a page outputs an HTML table eg:
<table width="100" cellspacing="0" cellpadding="0"> <tr> <td>a</td> <td>b</td> <td>c</td> <td>d</td> <td>e</td> </tr> <tr> <td>f</td> <td>g</td> <td>h</td> <td>i</td> <td>j</td> </tr> <tr> <td>k</td> <td>l</td> <td>m</td> <td>n</td> <td>o</td> </tr> <tr> <td>p</td> <td>q</td> <td>r</td> <td>s</td> <td>t</td> </tr> <tr> <td>u</td> <td>v</td> <td>w</td> <td>x</td> <td>y</td> </tr> </table> But I want to get that code into the $message variable. I have written many mail scripts before it's just getting the data into the variable. Should I be using something like CURL? On 02/06/06, Mark Cain <[EMAIL PROTECTED]> wrote:
For my server configuration (Unix), mailing works like this for me. In the simplest manner mailing works in the following way: <? // build the email $mail_to = [EMAIL PROTECTED]; $subject = "subject of mail goes here -- $variable_of_your_choosing"; $message = "The text of the message starts here $variable_of_your_choosing_2 $variable_of_your_choosing_3 "; $headers = "From: [EMAIL PROTECTED]" . "Reply-To: [EMAIL PROTECTED]"; //send email mail($mail_to, $subject, $message, $headers); ?> HTH, Mark Cain ----- Original Message ----- From: "Tom Chubb" <[EMAIL PROTECTED]> To: "[php] PHP General List" <php-general@lists.php.net> Sent: Friday, June 02, 2006 10:59 AM Subject: [PHP] HTML Mail script reading text from MySQL >I can't work out how to load the text from a recordset result into a > variable for sending using mail in a script. > I have a script which creates a dynamic table then I want to load the > table's HTML into a variable which will be echoed in the mail function. > I can't work out how to do this. > I've tried calling the file using exec and fopen but I don't get any > result. > > I have googled and RTFM (especially variable scope) but just can't work > out > how to do it. > Any help would be greatly appreciated. > > PS - I know there are many Mail classes out there, but I also realise that > this is something I will want to know how to do at a later time. > Thanks, > > Tom >
-- Tom Chubb [EMAIL PROTECTED] 07915 053312