Email not going

please this email code is not going , can you please have a look, it part of a code (the code above and below is working)


$body = "<html><body><table border='1'>
<tr>
<th></th>
<th>Shop Name</th>
<th>Product Name</th>
<th>Size</th>
<th>Color Name</th>
<th>Quantity</th>
<th>weblink</th>
<th>info</th>
<th>Price</th>
<th>Cost</th>
</tr>";
$totalPrices = 0;
$rowNum = 1;
$pplresult = mysql_query("SELECT * FROM repplac WHERE Uname = '{$_SESSION['username']}'ORDER BY Sname ASC");
while($row = mysql_fetch_assoc($pplresult)){
    $body .= "<tr>
         <td>".$rowNum++."</td>
        <td>" . $row['Sname'] ."</td>
        <td>" . $row['Pname'] ."</td>
        <td>" . $row['Psize'] ."</td>
        <td>" . $row['Pcolour'] ."</td>
        <td>" . $row['Pquantity'] ."</td>
        <td>" . $row['Weblink'] ."</td>
         <td>" . $row['comment'] ."</td>
        <td>" . $row['Price'] ."</td>
        <td>" . $row['Tprice'] ."</td>
        </tr>";
         $totalPrices += $row['Tprice'];
}
  if(0.1*$totalPrices <= 50 )
    {
    $totalprice = (0.1*$totalPrices +  $totalPrices);
    }
    else
   {
    $totalprice = 50 + $totalPrices;
        }
$body .= "<tr>
			<td colspan=8>Total :</td>
            <td>" . $totalprice ."</td>
        </tr>";
$body .="</table></body></html></br></br>";
$body .="$fullname</br>$houseno</br> $addressa</br>$addressb</br>$addressc</br>$county</br>$state</br>$country</br></br>";


   //Send email
   $Uname = "{$_SESSION['username']}";
   $emails ="mgltd@me.com";
   $to = $emails;
   $subject = "$Uname ORDER LIST($orderno) FROM REACHEASY ";
   $headers = "From: donotreply@reacheasy.co.uk\\r\
"
            . 'MIME-Version: 1.0' . "\\r\
"
            . 'Content-type: text/html; charset=iso-8859-1' . "\\r\
"
            . 'Bcc:notification@reacheasy.co.uk' . "\\r\
";

mail($to,$subject,$body,$headers);

First of all, do you run this script on localhost and, if yes, do you have an Email Server installed?
Second, add error_reporting(E_ALL) and check if you get any errors.
At a first look the code looks fine.

In the end, instead of just mail(… you should have


<?php
// ........
$did = @mail($to,$subject,$body,$headers);
if( false == $did ) {
    die('Cannot send!');
}
// this is how you know how the mail function does

I’m having an identical problem. I am running under a localhost downloaded to my laptop from XAMPP. How might I learn if an Email Server comes bundled with that package? Sounds like some [dreaded] configuration is required as well?

rgrds,

grNadpa

From memory an email program is included in the XAMPP install but you have to activate it in php.ini and setup a couple of settings.

In my setup its at line 1130.

Thanks for the heads-up.
I don’t know what line, but doing a CTRL+F search using “email” on the php.ini found

It writes all mails in the C:\xampp\mailoutput folder
And, sure enough, there they are. And that’s good enough for my testing purposes.