Hi, I have a while statement that gets information from a select mysql, and at the same time that while statement has more mysql selects inside. And I need to send the results by that while in an email with mail(). Is it posible and if so, how? I am really stuck on this.
dreamcatcher
7:29 am on Oct 12, 2008 (gmt 0)
Hi helenp,
Simply concatenate your string:
$string = '';
while ($something = mysql_fetch_object($row)) { $string .= ''; }
mail (email,subject,trim($string),headers);
dc
helenp
7:28 pm on Oct 12, 2008 (gmt 0)
Thanks Dreamcatcher. I have tried it as you sugested however get an empty email. This is the testfile I did (just to check it works, not my file). Something must be wrong, but what?. <?php $para = 'my_email@gmail.com'; $asunto = 'Test'; $cabeceras = 'MIME-Version: 1.0' . "\r\n"; $cabeceras .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $cabeceras .= 'From: ' . "\r\n"; $lol = 1; $string = ''; while ($lol < 10) { echo $lol; $lol++; $string .= ''; }
mail ($para,$asunto,trim($string),$cabeceras); ?> On the webpage I get as a result 123456789, which is correct however I get an empty email file.