0
 $headers = "From: reservation@speedypark.co.uk \r\n";
          $headers .= "Reply-To: reservation@speedypark.co.uk \r\n";
          $headers .= "MIME-Version: 1.0\r\n";
          $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
          mail($to, $subject, $message, $headers);

          $sql9=mysql_query("SELECT * FROM `carparks_accounts` WHERE `cpid`='".$row1['cpid']."'");
          $row9=mysql_fetch_assoc($sql9);
          $to2      = $row9['email'];
          $subject2 = "New Airport Parking Booking Confirmation";
          $message2 .= "<p>Your car park has received a new booking through SpeedyPark.</p>";
          $message2 .= "<p>Booking ID: <b>".$bid."</b></p>";
          $message2 .= "<p>Name: <b>".$row2['fname']." ".$row2['sname']."</b></p>";
          $message2 .= "<p>Drop Off Dates: <b>".date('d/m/Y', $row1['sdate'])." - ".$row1['stime']."</b></p>";
          $message2 .= "<p>Pick Up Dates: <b>".date('d/m/Y', $row1['edate'])." - ".$row1['etime']."</b></p>";
          $message2 .= "<p>Outbound Flight: <b>Terminal ".$row8['terminalout']." - Flight ".$row8['flightout']."</b></p>";
          $message2 .= "<p>Return Flight: <b>Terminal ".$row8['terminalin']." - Flight ".$row8['flightin']."</b></p>";
          $message2 .= "<p>Price: <b>".$row1['price']."</b></p>";
          $message2 .= "<p>Vehicle: <b>".$row4['reg']." - ".$row4['make']." ".$row4['model']." - ".$row4['colour']."</b></p>";
          if ($row1['cpeid'] == "") {
          } else {
            $message2 .= "<h3>Extras</h3>";
            $extralist = explode(', ', $row1['cpeid']);
            foreach($extralist as $value) //loop over values
            { 
            $sql17 = mysql_query("SELECT * FROM `carparks_extras` WHERE `id`='".$value."'");
            $row17 = mysql_fetch_assoc($sql7);
              $message2 .= $row17['name']."<br/>";
            }
          }
          $headers2 = "From: reservation@speedypark.co.uk \r\n";
          $headers2 .= "Reply-To: reservation@speedypark.co.uk \r\n";
          $headers2 .= "MIME-Version: 1.0\r\n";
          $headers2 .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
          mail($to2, $subject2, $message2, $headers2);
          $sql6 = "UPDATE `bookings` SET `status`='confirmed' WHERE `id`='".$bid."'";
          $results1 = mysql_query($sql6);

I have an ipn.php which won't work because the server is blacklisted and maybe another error with in the code. Would it be possible to change it to send through smtp settings? It loads the strings through mysql.

  • Yes, replace `mail` function with phpmailer http://phpmailer.worxware.com/?pg=examplebsmtp – Steve Jan 08 '16 at 13:07
  • Or use a transactional email service like mandril (free) – Steve Jan 08 '16 at 13:07
  • You need to [stop using mysql_ functions](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php) because they've been removed from PHP. – Machavity Jan 08 '16 at 13:13
  • Hi steve would it be easy to implement mandril with IPN or have i got the process mixed up and mandril is a process itself – marksww1 Jan 08 '16 at 13:55
  • Hello Mark, the above code is just a regular php script. The fact it gets called by paypal servers with IPN data is incidental - the script can do anything you like, including calling the madrill api to send an email – Steve Jan 08 '16 at 16:59
  • Steve, I'm not the wisest of people like some of the others on here. Would it be possible we speak over email or through direct message on here about a solution? marksww1 – marksww1 Jan 19 '16 at 11:21

0 Answers0