Re: mail()

From: Date: Sat, 05 Jul 2003 15:24:37 +0000
Subject: Re: mail()
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-154059@lists.php.net to get a copy of this message
Perfect solution. Thanks!!! ----- Original Message ----- From: "Dan Anderson" <dan@mathjunkies.com> To: <php-general@lists.php.net> Sent: Saturday, July 05, 2003 4:30 am Subject: Re: [PHP] mail() > > > 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); > ?> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#154059) next »