Jump to content

Problem with email script


jmcc

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.