I'm trying to create a simple email form where it automatically sends a quick message a user inputs to a hardcoded email address. the form i use looks like this:
<html>
<div id="body">
<form method="post" action="sendmail.php">
<table id="emailform">
<tr>
<td>First Name: </td>
<td><input name="firstName" type="text"/></td>
</tr>
<tr>
<td>Last Name: </td>
<td><input name="lastName" type="text"/></td>
</tr>
<tr>
<td>Email: </td>
<td><input name="email" type="text" /><br /></td>
</tr>
<tr>
<td valign="top">Message:</td>
<td><textarea name="message" rows="10" cols="40">
</textarea>
<br />
<input type="submit" /></td>
</tr>
</table>
</form>
</div><!--ending div id= body-->
</html>
and the actual mail sending code is this:
<?php
/*Here we are going to declare the variables*/
$firstName = $_POST['firstName'];
$lasName = $_POST['lastName'];
$email = $_POST['email'];
$message = $_POST['message'];
//Save visitor name and entered message into one variable:
$formcontent="VISITOR NAME: $firstName\n$lastName\nFEEDBACK: $message";
$recipient = "bflosabre91@yahoo.com";
$subject = "Contact Form";
$mailheader = "From: $email\r\n";
$mailheader .= "Reply-To: $email\r\n";
$mailheader .= "MIME-Version: 1.0\r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Failure!");
echo "Thank You!";
?>
and this is the error i get "Failure!PHP Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\Template\sendmail.php on line 13"
Any help I would really appreciate. Thanks
Colby