email php function repeat region not working
Posted: Fri Apr 12, 2013 11:47 am
i have a form that needs to be emailed and it as products attached to it. however i have a repeat region to list all the products but when i email it ithe email only shows the first item on the list.
below is the form set up
below is the form set up
Code: Select all
//emailer
// Email new tenant information
$to = 'sales@domain.com';// . ',' . '$row_rsOrder["Email"]';
//$to = $row_rsOrder["Email"];
$subject = "Your Order Details";
$message = "
<html>
<head>
<title>Dear ".$row_rsOrder['FirstName'].$row_rsOrder['LastName']." please see your Order Details Below</title>
</head>
<body>
<img src=\"http://www.website.com/images/logoBLPP.jpg\" alt=\"" />
<h2>Your B Order".$row_rsOrder['OrderID']."</h2>
<table width='800' border='0' cellspacing='0' cellpadding='0'>
<tr><td><p>Thank you for shopping below are you details of the order you have recently placed. If you have any questions please contact us</p>
<br />
</a></p>
<tr><td></td></tr></table>
<table width='980' border='1' cellspacing='0' cellpadding='10'>
<tr valign='top'>
<td bgcolor='#E9E9E9' class='header1'>Customer Name</td>
<td class='text'>".$row_rsOrder['FirstName'] . $row_rsOrder['LastName']."</td>
<td bgcolor='#E9E9E9' class='header1'>Order ID</td>
<td bgcolor='#E9E9E9' class='text'>".$row_rsOrder['OrderID']."</td>
<td bgcolor='#E9E9E9' class='header1'>Order Status</td>
<td class='text'>".$row_rsOrder['TransactResult']."</td>
</tr>
<tr valign='top'>
<td bgcolor='#E9E9E9' class='header1'>Email</td>
<td class='text'>".$row_rsOrder['Email']."</td>
<td bgcolor='#E9E9E9' class='header1'> </td>
<td class='text'> </td>
<td bgcolor='#E9E9E9' ><span class='header1'>Order Date</span></td>
<td class='text'>".makeDateTime($row_rsOrder['OrderDate'], '%#d %B %Y', true)."</td>
</tr>
<tr valign='top'>
<td bgcolor='#E9E9E9' class='header1'>Shipping Address</td>
<td class='text'><p>".$row_rsOrder['Address']."</p>
<p>".$row_rsOrder['Town']."</p>
<p>".$row_rsOrder['PostCode']."</p>
<p>".$row_rsOrder['Country']."</p>
<p> </p></td>
<td> </td>
<td> </td>
<td colspan='2' align='right' valign='bottom'><span class='header'> ORDER TOTAL:".DoFormatCurrency($row_rsOrder['Total'], 2, ',', '.', '£ ', '')."<br />
</span><span class='text'>Shipping:".DoFormatCurrency($row_rsOrder['Shipping'], 2, ',', '.', '£ ', '')."</span><span class='header'><br />
</span></td>
</tr>
<tr valign='top'>
<td bgcolor='#E9E9E9' class='header1'>Product ID</td>
<td bgcolor='#E9E9E9' class='header1'>Product Description</td>
<td bgcolor='#E9E9E9' colspan='2' class='header1'>Size</td>
<td bgcolor='#E9E9E9' ><span class='header1'>Quantity</span></td>
<td bgcolor='#E9E9E9' align='right'><span class='header1'>Price</span></td>
</tr>
<?php do { ?>
<tr valign='top'>
<td class='text'>".$row_rsOrder['ProductID']."</td>
<td class='text'>".$row_rsOrder['Product'].','.$row_rsOrder['catname']."</td>
<td colspan='2' class='text'>".$row_rsOrder['UnitSize']."</td>
<td><span class='text'>".$row_rsOrder['Quantity']."</span></td>
<td align='right' class='text'>". DoFormatCurrency($row_rsOrder['UnitPrice'], 2, ',', '.', '£ ', '')."</td>
</tr>
<?php } while ($row_rsOrder = mysql_fetch_assoc($rsOrder)); ?>
<tr valign='top'>
<td class='text'> </td>
<td class='text'> </td>
<td colspan='2' class='text'> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: company name <email@domain.com>' . "\r\n";
$send = mail($to, $subject, $message, $headers);