I've built a survey which uses sessions to store user input. Rather than putting this into an SQL database, I've decided to use PHP to email the data as the information isn't private or confidential. Here is my code, following ($_SERVER['REQUEST_METHOD'] == 'POST'):
$to = "xyz"; $subject = "Survey Response"; $message = "Test"; $from = "xyz"; $headers = "From:" . $from; mail($to,$subject,$message,$headers); session_destroy(); header('Location: page_6.php'); exit;
'xyz' is obviously where a valid email address needs to go. However, even when I've tried it with a valid email address, nothing seems to be sending. Can someone tell me what I've done wrong?
I also tried $message = print_r($_SESSION); but that didn't work either.
Thanks