Re: mail()

From: Date: Sat, 05 Jul 2003 09:30:58 +0000
Subject: Re: mail()
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-154042@lists.php.net to get a copy of this message
> > Could someone let me know if it is possible to pass a resultset of a query > > to a single variable so it can be included as the message part of the mail > > function? if I were you I would try something like... <?php $result = mysql_query($query); $email = NULL; // it's bad form to dot without clearing the variable while ($line = mysql_fetch_array($result,MYSQL_ASSOC)) { $email = $email . "Value 1: {$line['value_1']}\n"; $email = $email . "Value 2: {$line['value_2']}\n"; $email = $email . "Value 3: {$line['value_3']}\n"; // ... } mail('john.doe@existentialism.com','subject',$email); ?>

« previous php.general (#154042) next »