SuperPaperSam 0 Posted August 25, 2009 Report Share Posted August 25, 2009 (edited) I have a PHP form and it works fine but it says that it's from 'nobody' How can I fix this??? I want it to say it was sent from $emailFieldPHP Code <?php $emailsubject = 'Contact'; $webMaster = 'sorry w3schools i dont want everyone knowing my email'; $nameField = $_POST ['name']; $emailField = $_POST ['email']; $messageField = $_POST ['message']; $body = <<<EOD<br><hr><br>Name: $nameField <br>Email: $emailField <br><hr><br>Message: $messageField <br><br><hr><br>EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailsubject, $body, $headers); $theResults = <<<EOD<html><head><title>Email has been success fully sent!</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css"><!--body { background-color: #f1f1f1; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: normal; font-weight: normal; color: #666666; text-decoration: none;}--></style></head><div> <div align="left">Thank you for contacting me I will get back to you soon!</div></div></body></html>EOD;echo "$theResults"?> Any help would be appreciatedThanks! Edited August 25, 2009 by SuperPaperSam Quote Link to post Share on other sites
justsomeguy 1,135 Posted August 25, 2009 Report Share Posted August 25, 2009 You're trying to set the from address to the $email variable, that doesn't exist. Quote Link to post Share on other sites
SuperPaperSam 0 Posted August 25, 2009 Author Report Share Posted August 25, 2009 WOW. I just noticed that I should of put Field after it.... wow... im dumb...But thanks for the help Quote Link to post Share on other sites
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.