I created a form and php to send form details to my email. But when run the web pages via wampserver through localhost it displays an error as "Warning: 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 C:\wamp\www\My original web\PHP\ContactUs.php on line 22". I can't find where the error in line 22.
<div class="container">
<form name="htmlform" method="POST" action="../PHP/ContactUs.php">
<label for="name">Name</label>
<input type="text" id="name" name="name" placeholder="Your Name">
<label for="email">Email Address</label>
<input type="text" id="email" name="email" placeholder="Your Email Address">
<label for="phone">Phone Number</label>
<input type="text" id="phone" name="phone" placeholder="Your Phone Number">
<label for="Message">Message</label>
<textarea id="message" name="message" placeholder="Write You Something" style="height:200px"></textarea>
<input type="submit" value="Submit">
</form>
<?php
//if "email" variable is filled out, send email
if (isset($_REQUEST['email'])) {
//Email information
$admin_email = "pinkmaidbeautysalon@gmail.com";
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$phone = $_REQUEST['phone'];
$message = $_REQUEST['message'];
//send email
mail($admin_email, "$name", "$phone", "$message", "From:" . $email);
//Email response
echo "Thank you for contacting us!";
}
//if "email" variable is not filled out, display the form
else {
?>
<?php
}
?>