dynamically built variable in mail()

Hi everyone,

I’m new in every way and was having a small problem. I am using mail() to send customers an order confirmation. All works well and all variables display correctly. What I am having a problem with is within my variable $message, I have a dynamically created array variable called $cartOutput which has a list of all items purchased. In the email received by the customer $cartOutput displays all the items in one continuous line instead of 1 line per item.

Within my loop, the variable code looks like this:
$cartOutput .=‘Product: ’ . $product_name . ’ Price:’ . $product_price . ’ Quantity:’ . $product_quantity . ’ Line ttl:’ . $product_price . ‘’;
$cartOutput .= ‘’;

Within the quotes of the 2nd $cartOutput, I’ve tried \r\n , \n , even
but it just displays as regular text. Of course I tried removing the quotes but that gives me a syntax error.

I’ve even tried to put it in a table but that too shows the

, as text and still all in one line.

Any advise would be sincerely appreciated.

Sponsor our Newsletter | Privacy Policy | Terms of Service