Mail Command Body Issue - Trying to use 'do while' loop

From: Date: Sat, 12 Sep 2009 22:47:40 +0000
Subject: Mail Command Body Issue - Trying to use 'do while' loop
Groups: php.general php.general 
Request: Send a blank email to php-general+get-297958@lists.php.net to get a copy of this message
I'm having a problem with mail body issue trying to use 'do while' loop in the $mail_body var. this line: do { echo $row_get1['name'] } while ($row_get1 = mysql_fetch_assoc($get1)) will show ok when it's on the page elsewhere (not in the $mail_body var) but typed like: --- ok on web page (not email) <?php do { echo $row_get1['vt_name']; } while ($row_get1 = mysql_fetch_assoc($get1)); ?> Q: i want "TEXT" LOOP "TEXT" - AM I MISSING some syntax characters like(; or??) somewhere or ???? THANKS for your help - dave ----- full email code -------- <?php $mail_body = "test \n\n"."test2".do { echo 'test' } while ($row_get1 = mysql_fetch_assoc($get1))."Thanks test xxx"; ?> <?php $Name = "test"; //senders name $email = "test@test.com"; //senders e-mail adress $recipientname = "test@test.com"; $recipient = "test@test.com"; //recipient $subject = "test". $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields $fullto = $recipientname . " <" . $recipient . ">"; //$fullto = $recipientname . " <" . $recipient . ">".", ".$recip2; ini_set('sendmail_from', 'test@test.com'); mail($fullto, $subject, $mail_body, $header); //mail command :) ?> Thanks, cool@hosting4days.com

« previous php.general (#297958) next »