Mailing session variables?


If someone could help me on this I would be very grateful:

Basically what happens is once an order is added its POST variable is converted to a session variable:

<? foreach($_POST as $key => $val) { if($val != '') { $_SESSION[$key] = $val; } } ?>

Then a foreach loop outputs the session variables:
foreach($_SESSION as $key => $val)
{ …etc. }

Any ideas on how to mail these session variables using the mail() function?


Put the session variables in side the body of the message

$body = “Session variable 1 = $_SESSION[‘1’]nSession variable 2 = $_SESSION[‘2’]nSession variable 3 = $_SESSION[‘3’]n…”

mail($to, $subject, $body, $headers)