<?php
session_start();

$to = "yourcompany@email.com";
$subject = "New Order";

$message = "Customer ordered:\n";

foreach($_SESSION['cart'] as $item){
    $message .= "Product ID: $item\n";
}

$headers = "From: noreply@yourwebsite.com";

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

unset($_SESSION['cart']);

echo "Order placed successfully!";