jobs1109 Posted July 29, 2011 Share Posted July 29, 2011 Hi , I have a form were users fill out an email from then goes to second page but email does not get sent . When I print out the variables it prints out fine. Here is the code. What am I doing wrong ? <?php $_POST['Name'] = $_SESSION['Name']; $_POST['Email'] = $_SESSION['Email']; $_POST['Message'] = $_SESSION['Message']; $_POST['Email_Subject'] = $_SESSION['Email_Subject']; $to = "[email protected]"; $Name = $_POST['Name']; $Email = $_POST['Email']; $Message = $_POST['Message']; mail($to,$Name,$Email,$Message); echo $to; echo $Name; echo $Email; echo $Message; echo $headers; echo "Mail Sent."; ?> Link to comment https://forums.phpfreaks.com/topic/243168-email-problem/ Share on other sites More sharing options...
jobs1109 Posted July 29, 2011 Author Share Posted July 29, 2011 here is a link to the page http://www.hiringinhilo.com/Hilo-Jobs/Contact-US/index.php Link to comment https://forums.phpfreaks.com/topic/243168-email-problem/#findComment-1248941 Share on other sites More sharing options...
WebStyles Posted July 29, 2011 Share Posted July 29, 2011 What were you attempting to do with this? $_POST['Name'] = $_SESSION['Name']; $_POST['Email'] = $_SESSION['Email']; $_POST['Message'] = $_SESSION['Message']; $_POST['Email_Subject'] = $_SESSION['Email_Subject']; also, the mail() function takes in the following parameters, in this order: mail(destinationEmail, Subject, Message, Headers); you're using: mail($to,$Name,$Email,$Message); and... this: echo $to; echo $Name; echo $Email; echo $Message; echo $headers; echo "Mail Sent."; is just going to print out a string without any line breaks or spaces between values, and also throw an undefined error (since $headers doesn't exist in your script) Link to comment https://forums.phpfreaks.com/topic/243168-email-problem/#findComment-1248960 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.