Re: HTML Mail script reading text from MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <mark@xxxxxxxxxxxx> 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 = joe_blow@xxxxxxxxx;

$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: You@xxxxxxxxxxxxxx\r\n" .
"Reply-To: You@xxxxxxxxxxxxxx\r\n";

//send email
mail($mail_to, $subject, $message, $headers);
?>


HTH,

Mark Cain

----- Original Message -----
From: "Tom Chubb" <tomchubb@xxxxxxxxx>
To: "[php] PHP General List" <php-general@xxxxxxxxxxxxx>
Sent: Friday, June 02, 2006 10:59 AM
Subject:  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
tom@xxxxxxxxxxxxxx
07915 053312

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux