Jump to content

PHP mail() function


JamesKoash
Go to solution Solved by JamesKoash,

Recommended Posts

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

Edited by JamesKoash
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.