Here is the html/php code I'm using:
- Code: Select all
<form action="" method="post" name="email" id="email">
<p>
<label for="emailAdd" class="question">Email:</label>
<input name="emailAdd" type="text" id="emailAdd" size="30" />
</p>
<p>
<label for="comment" class="question">Question:</label>
<textarea name="comment" id="comment" cols="30" rows="5"></textarea>
</p>
<p>
<input type="submit" name="submit" id="submit" value="Submit">
<input type="hidden" name="submitted" value="1" />
</p>
</form>
<?php
if(isset($_POST['submitted']))
{
if(mail('myemail@mydomain.com','Contact Form Submission',$_POST['comment'],$_POST['emailAdd']))
echo "Good";
else echo "Bad";
}
?>
How do I correctly set this up?
Here is the result:
- Code: Select all
<b>Warning</b>: mail() [<a href='function.mail'>function.mail</a>]: "sendmail_from" not set in php.ini or custom "From:" header missing in <b>C:\Program Files\xampp\htdocs\HTMLSite2\contact.php</b> on line <b>81</b><br />
Bad