Languages :: PHP :: multiple results into one email per person. |
|||
| By: vince2874 |
Date: 02/10/2003 00:00:00 |
Points: 45 | Status: Answered Quality : Excellent |
|
Hi all, got some problems here.. How can I send results from my fetch arrays (from database) to each person with one email each? For example my fetch array results return: $result1 $result2 $result3 $result4 //I need to send these results to 5 people but each person only receive one email containing these 4 $results. Instead of each person receive 4 emails contain of 1 result. Will be more helpful if got some examples. thx in advance |
|||
| By: VGR | Date: 02/10/2003 04:57:00 | Type : Comment |
|
| easy. You agregate the results and format the body of your email sending in the while($res=mysql_fetch_array()) loop, ***then only*** you loop through the recipients and send each of them the whole body you prepared beforehand... no other way regards |
|||
| By: VGR | Date: 02/10/2003 17:00:00 | Type : Answer |
|
| like : <?php $recipients=array('me@totor.com','yourself@ibm.com'); // here conect, perform query // send emails with results $themessage=""; while ($res=mysql_fetch_array($result)) { // build the message $themessage.=$res['theresult']."\r\n"; // results will be each on its line } // while // now send the emails foreach ($recipients as $email) { mail($email,'here are your results',$themessage); // add extra headers if need be } // foreach ?> |
|||
| By: vince2874 | Date: 03/10/2003 05:55:00 | Type : Comment |
|
| thanks! |
|||
| By: vince2874 | Date: 10/10/2003 16:58:00 | Type : Comment |
|
| Hi VGR, is it possible to have the recipient fetch from my table? $recipients=array('me@totor.com','yourself@ibm.com'); I tried this but can't work $recipients=table[email]; any helps? thanks |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








