nelquintin Posted August 14, 2006 Share Posted August 14, 2006 i want to develop a site where i can email certain clients infomation.i already have the search and display option working.when a new product comes on the market i want to email only the clients which came up in the searh query.So say for instance all the clients name and email address are displayed on a page ,how do i gather the email on that page and send the product via php. Quote Link to comment Share on other sites More sharing options...
shocker-z Posted August 14, 2006 Share Posted August 14, 2006 It depends on how you pull all the data into the page really.. if your pulling it in from a database then you might as well add the mail() function into the loop and email each users as it loops thru your query..Another way would be to put a tick box by your results like <inpute type="checkbox" name="emailaddress[]" value="<?php echo $row['emailaddress']; ?>">And then a email now button at the bottom of the page and then on the page it submits too doforeach ($_POST['emailaddress'] as $email) {//put all info needed inside mail below using $email for the recipients addressmail();}just a breif of ideas..RegardsLiam Quote Link to comment Share on other sites More sharing options...
nelquintin Posted August 15, 2006 Author Share Posted August 15, 2006 Thanks for that maybe i can take a diffrent approach.The site for a estate agency what i want to do is get a property from the site and match all the clients in my database to that property and then email that spefic property to those clients.I have added my code in if it helps.Your help in this is much appricated.This is how i pull up the propertys:<?phpmysql_connect("localhost","root","pass123"); mysql_select_db("vap"); $search = $_POST["search"]; $query = "SELECT * FROM propertys WHERE ref LIKE '%".$_POST['search']."'";$result = mysql_query($query); if (mysql_num_rows($result)) { while ($row = mysql_fetch_array($result)) { $picture = $row["picture"]; $minprice = $row["minprice"]; $maxprice = $row["maxprice"]; $price = $row["price"]; $ref = $row["ref"]; $type = $row["type"]; $erf = $row["erf"]; $size = $row["size"]; $bed = $row["bed"]; $bath = $row["bath"]; $gar = $row["gar"]; echo "<image src=\"$picture ","\" style=\"border: 2px solid black;\"><br><br>"; echo "<br> $ref <br> $price <br> $type <br> $erf <br> $size <br> $bed <br> $bath <br> $gar <br>"; } } ?>I pull up the clients in a similar way. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.