Hi Everyone,

I am working on a shopping cart. In which i am sending mail which product customer want to shop. But i am ubable to fetch more than one product with different name . Because for this i need a loop. And i am not understanding how i can call a loop or array in mail message.Like i want message should go in this way:

Thanks for shopping with us. You have placed order of these products:-----
1st Product Name: ----name--
Prodcut price:----price1 value--
Prodcut quantity:---quantity---
2nd Product Name:----name---
Prodcut price:----price2 value--
Prodcut quantity:---quantity---
3rd Product Name:----name---
Prodcut price:----price3 value--
Prodcut quantity:---quantity---

Total price of these all product: price1+price2+price3
Postage Charge:------value--------
Total:---------total price+postage charge
If you have any query about your order placed or for further Convenience, you can contact us or call us here:-

---------------address information---------

So here i am unable to fetch these three product information in mail which customer is receiving through shopping cart . It is fetching only last one product info which customer is adding in cart and it is showing only that product.

Please suggest me . How i can do this. It is very urgent for me.

Build the values first and add it in the message part of the mail..
Something like this,

foreach($product as $value) {
$message .= $value ." is in the cart.<br />";
mail("someuser@gmail.com","Welcome",$message,"From: someone@gmail.com");

yes..Make a string first with all the values u have using the looping structure in php ..And then send that string

This article has been dead for over six months. Start a new discussion instead.