Mailing session variables?


#1

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?


#2

Put the session variables in side the body of the message
[php]

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

mail($to, $subject, $body, $headers)
[/php]