jmcc Posted September 25, 2009 Share Posted September 25, 2009 It seems as thought $to2 does'nt receive a value. my result is : "email was sent to" .... with no email address Here is my code: ////////////////////////////////////// SEND EMAILS TO PRIVATE BUYERS ////////////////////////////// <?php> elseif($to == "Buyers") { mysql_select_db($database_prop, $prop); $query_dist = ("SELECT DISTINCT email FROM private_buyer WHERE notify = '1' AND province = '$provDis' AND city = '$cityDis'"); $dist = mysql_query($query_dist, $prop) or die(mysql_error()); $totalRows_dist = mysql_num_rows($dist); if($totalRows_dist > 0) { while($rows_dist = mysql_fetch_assoc($dist)) { // send e-mail to ... $to2 = $row_dist['email']; // Your subject $subject="Property Distribution"; // From $header="from: Property Networking Solutions"; // Your message $messages= "Match alert notification\t\n\t\nThis property was sent to you by Property Networking Solutions.\t\n\t\nProperty Description:\t\nType: $proptype\t\nProvince: $propprov\t\nCity: $propcit\t\nSuburb: $propsub\t\nPrice: R $propprice\t\n\t\nHere is a link to the property: http://www.siet.co.za/buyer_detail_view.php?id=$propid\t\n\t\n\t\n" ; // send email if(mail($to2,$subject,$messages,$header)) { echo 'mail sent to '.$to2; } else { echo 'mail not sent to '.$to2; } } } } <?> Link to comment https://forums.phpfreaks.com/topic/175501-problem-with-email-script/ Share on other sites More sharing options...
Bricktop Posted September 25, 2009 Share Posted September 25, 2009 Hi jmcc, $row_dist['email']; Should be: $rows_dist['email']; Hope this helps. Link to comment https://forums.phpfreaks.com/topic/175501-problem-with-email-script/#findComment-924754 Share on other sites More sharing options...
jmcc Posted September 25, 2009 Author Share Posted September 25, 2009 Thank you it is solved Link to comment https://forums.phpfreaks.com/topic/175501-problem-with-email-script/#findComment-924774 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.