Hi,
I have a very weird problem sending the below script. The email gets sent successfully but when you get the email, there will be only few lines only....rest of them doesn't get printed in email but if you echo it on screen, it appears all perfect. See attachment for the email output i receive.
Can someone let me know what's wrong with the script..thanks
<?php
$message = "<html><body>";
$message .="<table width='760' border='1' align='center' cellpadding='0' cellspacing='0' bordercolor='#E3085E' style='border-collapse:collapse'>";
$message .="<tr>";
$message .="<td><table width='725' border='0' align='center' cellpadding='0' cellspacing='0'>";
$message .="<tr>";
$message .="<td height='5' colspan='2'></td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td width='188' valign='top'>";
$message .="<strong>test<br>";
$message .="Address 1<br>";
$message .="Address 2<br>";
$message .="Ph: 1111 1111 1111</strong><br>";
$message .="</td>";
$message .="<td width='562'></td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td colspan='2'> </td>";
$message .="</tr>";
$message .="<tr>";
$message .=" <td colspan='2'>Thank you for shopping with us. Your order information follows.</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td height='5' colspan='2'></td>";
$message .=" </tr>";
$message .=" <tr><td colspan='2'> PURCHASE ORDER</td></tr>";
$message .=" <tr><td height='5' colspan='2'></td></tr>";
$message .=" <tr>";
$message .=" <td colspan='2'><table width='750' border='0' cellspacing='2' cellpadding='2'>";
$message .=" <tr>";
$message .=" <td height='25' colspan='2' bgcolor='#000000'>Order Information</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td width='108'>Order Number:</td>";
$message .=" <td width='636'>1115</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td >Order Date:</td>";
$message .=" <td >Wednesday, 17 February 2010</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td >Order Status:</td>";
$message .=" <td >Confirmed</td>";
$message .=" </tr>";
$message .=" </table></td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td colspan='2'> </td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td colspan='2' valign='top'><table width='750' border='0' cellspacing='0' cellpadding='0'>";
$message .=" <tr>";
$message .=" <td width='323'><table width='100%' border='0' cellpadding='2' cellspacing='2'>";
$message .=" <tr>";
$message .=" <td height='25' colspan='2' bgcolor='#000000' class='style5'>Customer Information</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td width='108' class='style5'>Company Name:</td>";
$message .=" <td width='253' class='style5'>test<br></td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>Full Name:</td>";
$message .=" <td class='style5'>test</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>Address 1:</td>";
$message .=" <td class='style5'>test</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>Address 2:</td>";
$message .=" <td class='style5'> </td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>City:</td>";
$message .=" <td class='style5'>test</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>State:</td>";
$message .=" <td class='style5'>test</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>Email Address:</td>";
$message .=" <td class='style5'>test</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>Home Phone:</td>";
$message .=" <td class='style5'>test</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>Work Phone:</td>";
$message .=" <td class='style5'>test</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>Fax:</td>";
$message .=" <td class='style5'>test</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>Date of Birth:</td>";
$message .=" <td class='style5'> </td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>Drivers License:</td>";
$message .=" <td class='style5'>123456789</td>";
$message .=" </tr>";
$message .=" </table></td>";
$message .=" <td width='325' valign='top'><table width='100%' border='0' cellpadding='2' cellspacing='2'>";
$message .=" <tr>";
$message .=" <td height='25' colspan='2' bgcolor='#000000' class='style5'>Shipping Information</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td width='108' class='style5'>Firstname:</td>";
$message .=" <td class='style5'>test</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>Surname:</td>";
$message .=" <td class='style5'>test</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>Street:</td>";
$message .=" <td class='style5'>test</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>City:</td>";
$message .=" <td class='style5'>test</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>Postcode:</td>";
$message .=" <td class='style5'> </td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td class='style5'>State:</td>";
$message .=" <td class='style5'>test</td>";
$message .=" </tr>";
$message .=" </table></td>";
$message .=" </tr>";
$message .=" </table> </td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td colspan='2'> </td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td colspan='2'><table width='750' border='0' cellspacing='0' cellpadding='0'>";
$message .=" <tr>";
$message .=" <td height='25' colspan='6' bgcolor='#000000' class='style5'> Order Items</td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td width='67' bgcolor='#999999' class='style5'><div align='center'><strong>Quantity</strong></div></td>";
$message .=" <td width='368' height='20' bgcolor='#999999' class='style5'><strong>Name</strong></td>";
$message .=" <td width='98' bgcolor='#999999' class='style5'><strong>Price</strong></td>";
$message .=" <td width='97' bgcolor='#999999' class='style5'><div align='center'><strong>Weight</strong></div></td>";
$message .=" <td width='110' bgcolor='#999999' class='style5'><div align='right'><strong>Subtotal </strong></div></td>";
$message .=" <td width='10' bgcolor='#999999' class='style5'> </td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td height='25' class='style5'><div align='center'>1</div></td>";
$message .=" <td class='style5'>Test product 1</td>";
$message .=" <td class='style5'>$450.00</td>";
$message .=" <td class='style5'><div align='center'>500 ml.</div></td>";
$message .=" <td class='style5'><div align='right'>$450.00</div></td>";
$message .=" <td class='style5'> </td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td height='25' class='style5'><div align='center'>2</div></td>";
$message .=" <td height='25' class='style5'>Product 2</td>";
$message .=" <td height='25' class='style5'>$200.00</td>";
$message .=" <td height='25' class='style5'><div align='center'>1000 ml.</div></td>";
$message .=" <td height='25' class='style5'><div align='right'>$400.00</div></td>";
$message .=" <td class='style5'> </td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td height='25' class='style5'> </td>";
$message .=" <td height='25' class='style5'> </td>";
$message .=" <td height='25' colspan='2' class='style5'><div align='right'>Subtotal:</div></td>";
$message .=" <td height='25' class='style5'><div align='right'>$850.00</div></td>";
$message .=" <td class='style5'> </td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td height='25' class='style5'> </td>";
$message .=" <td height='25' class='style5'> </td>";
$message .=" <td height='25' colspan='2' class='style5'><div align='right'>Discount:</div></td>";
$message .=" <td height='25' class='style5'><div align='right'> - $0.00</div></td>";
$message .=" <td class='style5'> </td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td height='25' class='style5'> </td>";
$message .=" <td height='25' class='style5'> </td>";
$message .=" <td height='25' colspan='2' class='style5'><div align='right'>Shipping:</div></td>";
$message .=" <td height='25' class='style5'><div align='right'>+ $17.25</div></td>";
$message .=" <td class='style5'> </td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td height='25' class='style5'> </td>";
$message .=" <td height='25' class='style5'> </td>";
$message .=" <td height='25' colspan='2' class='style5'><div align='right'>Tax:</div></td>";
$message .=" <td height='25' class='style5'><div align='right'>+ $25.00</div></td>";
$message .=" <td class='style5'> </td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td height='20' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'> </td>";
$message .=" <td height='20' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'> </td>";
$message .=" <td height='20' colspan='2' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'><div align='right'><strong>Total:</strong></div></td>";
$message .=" <td height='20' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'><div align='right'><strong>$892.25</strong></div></td>";
$message .=" <td height='20' bgcolor='#999999' class='style5'> </td>";
$message .=" </tr>";
$message .=" </table></td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td height='5' colspan='2'></td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td colspan='2'><span class='style5'>Thank you for your purchase.</span></td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td colspan='2'><span class='style5'><a href='#'>Click here</a> if you have any questions/problems.</span></td>";
$message .=" </tr>";
$message .=" <tr>";
$message .=" <td height='5' colspan='2'></td>";
$message .=" </tr>";
$message .=" </table></td>";
$message .=" </tr>";
$message .="</table>";
$message .="</body></html>";
$from_name = "domain";
$from_email = "darshan@domain.com";
//$headers = "From: $from_name <$from_email>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $from_email\r\n";
$subject = "Order Confirmation";
$to = "darshan@localhost";
if (mail($to, $subject, $message, $headers)) {
echo "success!";
} else {
echo "fail…";
}
echo $message;
?>
Thanks