New line in email, and decimal point

hello, i have been trying to get a newline in an email, i have tried '\r
’ and i have also tried

, i dont know where i am getting it wrong, and also i included a transaction amount ($tranx_amt) in the email, and it is coming up with 4 decimal places. the markup is below.

 $body = " Hello $cust_id\\r\

";
$body .= “We are happy to inform you that your order has been placed,

Thanks for the making the payment of $tranx_amt ,

Your Payment reference no is $orderno”;.

this is the header (the email also contains tables in the body thats why the html type is in the heading)

 $headers = "From: donotreply@reacheasy.co.uk\\r\
"
            . 'MIME-Version: 1.0' . "\\r\
"
            . 'Content-type: text/html; charset=iso-8859-1' . "\\r\
"
            . 'Bcc:notification@grant.co.uk' . "\\r\
";

any ideas on the new line and the decimal places.

cheers

If you are sending ‘Content-type: text/html’ then your message is in HTML. Newline in HTML is accomplished with the <br> tag.

ok will try now

thank for the info, please do you have any idea with the extra decimal points . intead of 7560.58 it is showing in the email as 7560.5800

Use number_format() on your amount.


$body .= "We are happy to inform you that your order has been placed,\
\
 Thanks for the making the payment of ". number_format($tranx_amt, 2, '.') ." ,<br />Your Payment reference no is $orderno";.


it is not recognizing the transaction amount it, the result is

Hello username
We are happy to inform you that your order has been placed, Thanks for the making the payment of ,
Your Payment reference no is 63749966

number_format() cannot accept 3 parameters, there need to be 1, 2 or 4, like this:

number_format($tranx_amt, 2, '.', '')

BTW, if you use Content-type: text/plain then you can use
as the newline.

thanks