| | |
How we can put loop in a mail message in php????
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2009
Posts: 130
Reputation:
Solved Threads: 0
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.
thanks,
gagan
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.
thanks,
gagan
Last edited by gagan22; Apr 23rd, 2009 at 4:44 am.
Build the values first and add it in the message part of the mail..
Something like this,
Something like this,
php Syntax (Toggle Plain Text)
<?php foreach($product as $value) { $message .= $value ." is in the cart.<br />"; } mail("someuser@gmail.com","Welcome",$message,"From: someone@gmail.com"); ?>
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
![]() |
Similar Threads
- Swift mailer log (PHP)
Other Threads in the PHP Forum
- Previous Thread: Form with no bars
- Next Thread: How to take printout from php page upto only values getting from mysql
| Thread Tools | Search this Thread |
.htaccess alerts apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code convert cron curl database dataentry date display duplicates dynamic echo email emptydisplayvalue error errors execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google hack href htaccess html htmlspecialchars image include insert ip javascript joomla keywords limit link login loop mail menu methods mlm multiple mysql network object oop paypal pdf php problem query radio random recursion recursive redirect remote script search securephp server sessions shot sms source space sql subscription syntax system table tutorial tutorials update upload url validator variable video web youtube






