Hi.. I would like to send an order confirmation email with the cart details. But it doesn't show the string in php, only html.
My script:

$to = 'adolph@site.it';
$subject = 'New Order';
$from = 'info@newsite.it'; 

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 // Create email headers
$headers .= 'From: '.$from."\r\n".
    'Reply-To: '.$from."\r\n" .

$message = '<html><body>';
$message .= '<h1 style="color:#f40;">Thanks for Your Order</h1>';
$message .= '<p style="color:#080;font-size:18px;"> Your order  details:</p>';
$message .= '<?php echo $array_cart_name[$i]; ?>';      //NOT WORK  
$message .= '</body></html>';


mail($to, $subject, $message, $headers);

Result:
Thanks for Your Order
Your order details:

<?php echo  $array_cart_name[$i]; ?>  This is Hidden

A solution is possible??

Solved:

$to = 'adolph@site.it';
$subject = 'New Order';
$from = 'info@newsite.it'; 

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 // Create email headers
$headers .= 'From: '.$from."\r\n".
    'Reply-To: '.$from."\r\n" .

$message = '<html><body>';
$message .= '<h1 style="color:#f40;">Thanks for Your Order</h1>';
$message .= '<p style="color:#080;font-size:18px;"> Your order  details:</p>';

$message .= '</body></html>';

$message .= '<?php echo $array_cart_name[$i]; ?>';      //Now WORK  

mail($to, $subject, $message, $headers);
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.