Puedes insertar php, pero ten encuenta que el php se ejecuta antes de mandar el mail y no pudes meter un for dentro! seria algo asi:
Código PHP:
$cuerpo = '
<html>
<head>
<title>Your purchase</title>
</head>
<body>
<h3>Store xxx</h3>
<b>Payment Details:</b>
-Id: '.$txn_id.'<br>
-Date: '.$paymentDate.'<br>
-Status: '.$payment_status'.'.$pend.'<br><br>
';
for ($c = 1; $c < $nitems; $c++){
$quant = $keyarray['quantity'.$c];
$itemname = $keyarray['item_name'.$c];
$price = $keyarray['mc_gross_'.$c];
$itemnumber = $keyarray['item_number'.$c];
$cuerpo .= "-$itemname (x$quant)<br>\n $price EUR<br>\n";
}
$cuerpo .= '
</body>
</html>
';
mail($destinatario,$asunto,$cuerpo,$headers);
Yo lo dejaria algo asi.
Saludos.