while...

From: Date: Wed, 12 Jun 2002 20:26:53 +0000
Subject: while...
Groups: php.general 
Request: Send a blank email to php-general+get-101812@lists.php.net to get a copy of this message
I have a function in my script which sends an e-mail to my client company with details of a shopping cart order. I was wondering if it is possible to use a while loop inside the mail function so that I can send details of multiple items in one e-mail. Here is the code I am using. And bear in mind that I am a newbie to PHP, so if the mistake is obvious you will need to forgive me. $message = "-----------Client Information-----------\nUsername: $result[username]\nE-Mail Address: $result[email]\nContact Method: $contactoption\nForename: $result[forename]\nSurname: $result[surname]\nCompany: $result[company]\nHouse Number or Name: $result[address1]\nAddress Line 2: $result[address2]\nAddress line 3(optional): $result[address3]\nLocality: $result[local]\nCity: $result[city]\nPostcode: $result[postcode]\nHome Telephone: $result[homephone]\nWork Phone: $result[workphone]\nMobile Phone: $result[mobilephone]\nID: $result[id]\n----------Order Details----------while ($shoppingrow = mysql_fetch_array($shoppingresult))\nGrade: $shoppingrow[0]\nLength: $shoppingrow[1]"; $extra = "From: $result[forename]\r\nReply-To: $result[email]\r\n"; mail ("phil@philip-reid.com", "James Laird Website Order", $message); If anyone can be of assistance it would be very much appreciated. Regards, Phil Reid

« previous php.general (#101812) next »