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'>&nbsp;</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'>&nbsp;</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'>&nbsp;</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'>&nbsp;</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'>&nbsp;</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'>&nbsp;</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'>&nbsp;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'>&nbsp;</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'>&nbsp;</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'>&nbsp;</td>";
$message .="            </tr>";
$message .="            <tr>";
$message .="              <td height='25' class='style5'>&nbsp;</td>";
$message .="              <td height='25' class='style5'>&nbsp;</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'>&nbsp;</td>";
$message .="            </tr>";
$message .="            <tr>";
$message .="              <td height='25' class='style5'>&nbsp;</td>";
$message .="              <td height='25' class='style5'>&nbsp;</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'>&nbsp;</td>";
$message .="            </tr>";
$message .="            <tr>";
$message .="              <td height='25' class='style5'>&nbsp;</td>";
$message .="              <td height='25' class='style5'>&nbsp;</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'>&nbsp;</td>";
$message .="            </tr>";
$message .="            <tr>";
$message .="              <td height='25' class='style5'>&nbsp;</td>";
$message .="              <td height='25' class='style5'>&nbsp;</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'>&nbsp;</td>";
$message .="            </tr>";
$message .="            <tr>";
$message .="              <td height='20' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'>&nbsp;</td>";
$message .="              <td height='20' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'>&nbsp;</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'>&nbsp;</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

It seems inside <td> you have opened a new table, perhaps it would be stopping your execution, try removing that table tag in td and try with out that table.

It seems inside <td> you have opened a new table, perhaps it would be stopping your execution, try removing that table tag in td and try with out that table.

Tried that also....but it doesn't make any difference !!!!

Its really weird.....

Tried that also....but it doesn't make any difference !!!!

Its really weird.....

Then try like this...

$message = "

<table width='760' border='1' align='center' cellpadding='0' cellspacing='0' bordercolor='#E3085E' style='border-collapse:collapse'>
<tr>
<td><table width='725' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr>
<td height='5' colspan='2'></td>
</tr>
<tr>
<td width='188' valign='top'>
	<strong>test<br>
	Address 1<br>
	Address 2<br>
	Ph: 1111 1111 1111</strong><br>
</td>
<td width='562'></td>
</tr>
<tr>
<td colspan='2'>&nbsp;</td>
</tr>
<tr>
        <td colspan='2'>Thank you for shopping with us. Your order information follows.</td>
      </tr>
      <tr>
        <td height='5' colspan='2'></td>
      </tr>
      <tr><td colspan='2'> PURCHASE ORDER</td></tr>
      <tr><td height='5' colspan='2'></td></tr>
      <tr>
        <td colspan='2'>
				<table width='750' border='0' cellspacing='2' cellpadding='2'>
            <tr>
              <td height='25' colspan='2' bgcolor='#000000' style='color:#fff'>Order Information</td>
            </tr>
            <tr>
              <td width='108'>Order Number:</td>
              <td width='636'>1115</td>
            </tr>
            <tr>
              <td >Order Date:</td>
              <td >Wednesday, 17 February 2010</td>
            </tr>
            <tr>
              <td >Order Status:</td>
              <td >Confirmed</td>
            </tr>
        </table>
		</td>
      </tr>
      <tr>
        <td colspan='2'>&nbsp;</td>
      </tr>
      <tr>
        <td colspan='2' valign='top'>
				<table width='750' border='0' cellspacing='0' cellpadding='0'>
          <tr>
            <td width='323'><table width='100%' border='0' cellpadding='2' cellspacing='2'>
              <tr>
                <td height='25' colspan='2' bgcolor='#000000'  style='color:#fff' class='style5'>Customer Information</td>
              </tr>
              <tr>
                <td width='108' class='style5'>Company Name:</td>
                <td width='253' class='style5'>test<br></td>
              </tr>
              <tr>
                <td class='style5'>Full Name:</td>
                <td class='style5'>test</td>
              </tr>
  <tr>
                <td class='style5'>Address 1:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Address 2:</td>
                <td class='style5'>&nbsp;</td>
              </tr>
              <tr>
                <td class='style5'>City:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>State:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Email Address:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Home Phone:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Work Phone:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Fax:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Date of Birth:</td>
                <td class='style5'>&nbsp;</td>
              </tr>
              <tr>
                <td class='style5'>Drivers License:</td>
                <td class='style5'>123456789</td>
              </tr>
            </table></td>
            <td width='325' valign='top'><table width='100%' border='0' cellpadding='2' cellspacing='2'>
              <tr>
                <td height='25' colspan='2' bgcolor='#000000' class='style5'  style='color:#fff'>Shipping Information</td>
              </tr>
              <tr>
                <td width='108' class='style5'>Firstname:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Surname:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Street:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>City:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Postcode:</td>
                <td class='style5'>&nbsp;</td>
              </tr>
              <tr>
                <td class='style5'>State:</td>
                <td class='style5'>test</td>
              </tr>
            </table></td>
          </tr>
        </table>
		</td>
      </tr>
      <tr>
        <td colspan='2'>&nbsp;</td>
      </tr>

      <tr>
        <td colspan='2'><table width='750' border='0' cellspacing='0' cellpadding='0'>
            <tr>
              <td height='25' colspan='6' bgcolor='#000000'  style='color:#fff' class='style5'>&nbsp;Order Items</td>
            </tr>
            <tr>
              <td width='67' bgcolor='#999999' class='style5'><div align='center'><strong>Quantity</strong></div></td>
              <td width='368' height='20' bgcolor='#999999' class='style5'><strong>Name</strong></td>
              <td width='98' bgcolor='#999999' class='style5'><strong>Price</strong></td>
              <td width='97' bgcolor='#999999' class='style5'><div align='center'><strong>Weight</strong></div></td>
              <td width='110' bgcolor='#999999' class='style5'><div align='right'><strong>Subtotal </strong></div></td>
              <td width='10' bgcolor='#999999' class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='25' class='style5'><div align='center'>1</div></td>
              <td class='style5'>Test product 1</td>
              <td class='style5'>$450.00</td>
              <td class='style5'><div align='center'>500 ml.</div></td>
              <td class='style5'><div align='right'>$450.00</div></td>
              <td class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='25' class='style5'><div align='center'>2</div></td>
              <td height='25' class='style5'>Product 2</td>
              <td height='25' class='style5'>$200.00</td>
              <td height='25' class='style5'><div align='center'>1000 ml.</div></td>
              <td height='25' class='style5'><div align='right'>$400.00</div></td>
              <td class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' colspan='2' class='style5'><div align='right'>Subtotal:</div></td>
              <td height='25' class='style5'><div align='right'>$850.00</div></td>
              <td class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' colspan='2' class='style5'><div align='right'>Discount:</div></td>
              <td height='25' class='style5'><div align='right'> - $0.00</div></td>
              <td class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' colspan='2' class='style5'><div align='right'>Shipping:</div></td>
              <td height='25' class='style5'><div align='right'>+ $17.25</div></td>
              <td class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' colspan='2' class='style5'><div align='right'>Tax:</div></td>
              <td height='25' class='style5'><div align='right'>+ $25.00</div></td>
              <td class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='20' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'>&nbsp;</td>
              <td height='20' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'>&nbsp;</td>
              <td height='20' colspan='2' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'><div align='right'><strong>Total:</strong></div></td>
              <td height='20' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'><div align='right'><strong>$892.25</strong></div></td>
              <td height='20' bgcolor='#999999' class='style5'>&nbsp;</td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td height='5' colspan='2'></td>
      </tr>
      <tr>
        <td colspan='2'><span class='style5'>Thank you for your purchase.</span></td>
      </tr>

      <tr>
        <td colspan='2'><span class='style5'><a href='#'>Click here</a> if you have any questions/problems.</span></td>
      </tr>
      <tr>
        <td height='5' colspan='2'></td>
      </tr>
    </table></td>
  </tr>
</table>";

If even this also doesn't works for you, it might be the problem of your mail server problem

Then try like this...

$message = "

<table width='760' border='1' align='center' cellpadding='0' cellspacing='0' bordercolor='#E3085E' style='border-collapse:collapse'>
<tr>
<td><table width='725' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr>
<td height='5' colspan='2'></td>
</tr>
<tr>
<td width='188' valign='top'>
	<strong>test<br>
	Address 1<br>
	Address 2<br>
	Ph: 1111 1111 1111</strong><br>
</td>
<td width='562'></td>
</tr>
<tr>
<td colspan='2'>&nbsp;</td>
</tr>
<tr>
        <td colspan='2'>Thank you for shopping with us. Your order information follows.</td>
      </tr>
      <tr>
        <td height='5' colspan='2'></td>
      </tr>
      <tr><td colspan='2'> PURCHASE ORDER</td></tr>
      <tr><td height='5' colspan='2'></td></tr>
      <tr>
        <td colspan='2'>
				<table width='750' border='0' cellspacing='2' cellpadding='2'>
            <tr>
              <td height='25' colspan='2' bgcolor='#000000' style='color:#fff'>Order Information</td>
            </tr>
            <tr>
              <td width='108'>Order Number:</td>
              <td width='636'>1115</td>
            </tr>
            <tr>
              <td >Order Date:</td>
              <td >Wednesday, 17 February 2010</td>
            </tr>
            <tr>
              <td >Order Status:</td>
              <td >Confirmed</td>
            </tr>
        </table>
		</td>
      </tr>
      <tr>
        <td colspan='2'>&nbsp;</td>
      </tr>
      <tr>
        <td colspan='2' valign='top'>
				<table width='750' border='0' cellspacing='0' cellpadding='0'>
          <tr>
            <td width='323'><table width='100%' border='0' cellpadding='2' cellspacing='2'>
              <tr>
                <td height='25' colspan='2' bgcolor='#000000'  style='color:#fff' class='style5'>Customer Information</td>
              </tr>
              <tr>
                <td width='108' class='style5'>Company Name:</td>
                <td width='253' class='style5'>test<br></td>
              </tr>
              <tr>
                <td class='style5'>Full Name:</td>
                <td class='style5'>test</td>
              </tr>
  <tr>
                <td class='style5'>Address 1:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Address 2:</td>
                <td class='style5'>&nbsp;</td>
              </tr>
              <tr>
                <td class='style5'>City:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>State:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Email Address:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Home Phone:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Work Phone:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Fax:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Date of Birth:</td>
                <td class='style5'>&nbsp;</td>
              </tr>
              <tr>
                <td class='style5'>Drivers License:</td>
                <td class='style5'>123456789</td>
              </tr>
            </table></td>
            <td width='325' valign='top'><table width='100%' border='0' cellpadding='2' cellspacing='2'>
              <tr>
                <td height='25' colspan='2' bgcolor='#000000' class='style5'  style='color:#fff'>Shipping Information</td>
              </tr>
              <tr>
                <td width='108' class='style5'>Firstname:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Surname:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Street:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>City:</td>
                <td class='style5'>test</td>
              </tr>
              <tr>
                <td class='style5'>Postcode:</td>
                <td class='style5'>&nbsp;</td>
              </tr>
              <tr>
                <td class='style5'>State:</td>
                <td class='style5'>test</td>
              </tr>
            </table></td>
          </tr>
        </table>
		</td>
      </tr>
      <tr>
        <td colspan='2'>&nbsp;</td>
      </tr>

      <tr>
        <td colspan='2'><table width='750' border='0' cellspacing='0' cellpadding='0'>
            <tr>
              <td height='25' colspan='6' bgcolor='#000000'  style='color:#fff' class='style5'>&nbsp;Order Items</td>
            </tr>
            <tr>
              <td width='67' bgcolor='#999999' class='style5'><div align='center'><strong>Quantity</strong></div></td>
              <td width='368' height='20' bgcolor='#999999' class='style5'><strong>Name</strong></td>
              <td width='98' bgcolor='#999999' class='style5'><strong>Price</strong></td>
              <td width='97' bgcolor='#999999' class='style5'><div align='center'><strong>Weight</strong></div></td>
              <td width='110' bgcolor='#999999' class='style5'><div align='right'><strong>Subtotal </strong></div></td>
              <td width='10' bgcolor='#999999' class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='25' class='style5'><div align='center'>1</div></td>
              <td class='style5'>Test product 1</td>
              <td class='style5'>$450.00</td>
              <td class='style5'><div align='center'>500 ml.</div></td>
              <td class='style5'><div align='right'>$450.00</div></td>
              <td class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='25' class='style5'><div align='center'>2</div></td>
              <td height='25' class='style5'>Product 2</td>
              <td height='25' class='style5'>$200.00</td>
              <td height='25' class='style5'><div align='center'>1000 ml.</div></td>
              <td height='25' class='style5'><div align='right'>$400.00</div></td>
              <td class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' colspan='2' class='style5'><div align='right'>Subtotal:</div></td>
              <td height='25' class='style5'><div align='right'>$850.00</div></td>
              <td class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' colspan='2' class='style5'><div align='right'>Discount:</div></td>
              <td height='25' class='style5'><div align='right'> - $0.00</div></td>
              <td class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' colspan='2' class='style5'><div align='right'>Shipping:</div></td>
              <td height='25' class='style5'><div align='right'>+ $17.25</div></td>
              <td class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' class='style5'>&nbsp;</td>
              <td height='25' colspan='2' class='style5'><div align='right'>Tax:</div></td>
              <td height='25' class='style5'><div align='right'>+ $25.00</div></td>
              <td class='style5'>&nbsp;</td>
            </tr>
            <tr>
              <td height='20' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'>&nbsp;</td>
              <td height='20' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'>&nbsp;</td>
              <td height='20' colspan='2' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'><div align='right'><strong>Total:</strong></div></td>
              <td height='20' bordercolor='#ECE9D8' bgcolor='#999999' class='style5'><div align='right'><strong>$892.25</strong></div></td>
              <td height='20' bgcolor='#999999' class='style5'>&nbsp;</td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td height='5' colspan='2'></td>
      </tr>
      <tr>
        <td colspan='2'><span class='style5'>Thank you for your purchase.</span></td>
      </tr>

      <tr>
        <td colspan='2'><span class='style5'><a href='#'>Click here</a> if you have any questions/problems.</span></td>
      </tr>
      <tr>
        <td height='5' colspan='2'></td>
      </tr>
    </table></td>
  </tr>
</table>";

If even this also doesn't works for you, it might be the problem of your mail server problem

That worked.....but why it won't work the other way ??

Also, if i use this way, how do i include mysql queries, etc ?

You can append your required data inside the string like....

$message = "<table><tr><td>Hi Mr.".$name_of_the_person."</td></tr></table>";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.