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 ("[EMAIL PROTECTED]", "James Laird Website Order",
$message);
 
If anyone can be of assistance it would be very much appreciated. 
 
Regards,
 
Phil Reid
 
 


Reply via email to