vettenut Posted November 26, 2011 Share Posted November 26, 2011 I do not receive email for my published php file which is: <?php ///// easend.php ///// $youremail = "acdelco40108@yahoo.com"; /*put the email address here, between quotes, the email address you want the message sent to*/ $to = $youremail; $email = $_POST['EMail']; $name2 = $_POST['Name']; $street2 = $_POST['Street']; $city2 = $_POST['City']; $state2 = $_POST['State']; $zip2 = $_POST['Zip']; $Phone = $_POST['Home_Phone']; $Cell = $_POST['Cell_Phone']; $education = $_POST['email1']; $comments = $_POST['email2'] ; $headers = "From:" . $email; $fields = array(); $fields{"Name"} = "Name"; $fields{"Street"} = "Street"; $fields{"City"} = "City"; $fields{"State"} = "State"; $fields{"Zip"} = "Zip"; $fields{"Home_Phone"} = "Home Phone"; $fields{"Cell_Phone"} = "Cell Phone"; $fields{"EMail"} = "Email"; $fields{"email1"} = "Education"; $fields{"email2"} = "Comments"; $subject = "We have received the following information from your employment application"; $body = "We have received the following information from your employment application:\n\n"; foreach($fields as $a => $b) { $body .= sprintf("%20s: %s\n",$b,$_POST[$a]); } mail ($to, $subject, $body, $headers); //send mail to owner #end create email vars $headers = "From:" . $to; mail ($email, $subject, $body, $headers); //send mail to user #end create email vars echo "<head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"2; URL=ThankYou.html\"></head>"; ?> Quote Link to comment Share on other sites More sharing options...
Laash Posted November 26, 2011 Share Posted November 26, 2011 Hi First of all, in PHP, you do arrays like this: $fields['Name']="$var or string"; Second, you need to send headers with your mail. Look here: http://www.w3schools.com/php/func_mail_mail.asp Quote Link to comment Share on other sites More sharing options...
vettenut Posted November 26, 2011 Author Share Posted November 26, 2011 I am not experienced with php. Exactly what do I need to change and to what? Thank you. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 26, 2011 Share Posted November 26, 2011 Hi First of all, in PHP, you do arrays like this: $fields['Name']="$var or string"; Second, you need to send headers with your mail. Look here: http://www.w3schools.com/php/func_mail_mail.asp Although I've never been able to find it documented in the manual, curly braces do seem to work to enclose array indices. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.