How can I send the email with PHP usin live server?
<?php
// include "contactform/contactform.php";
if (isset($_POST['submit'])){
$to = "[email protected]";
$subject = "Email From Website";
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$headers = "From : $email";
$sendMail = mail($to, $subject, $message, $headers);
if ($sendMail) {
echo "Email sent";
}else{
echo "something is wrong";
}
}
?>
<form action="index.php" method="POST" role="form" class="contactForm">
<div id="sendmessage">Your message has been sent. Thank you!</div>
<!-- <div id="errormessage"></div> -->
<div class="row">
<div class="col-md-12 mb-3">
<div class="form-group">
<input type="text" name="name" class="form-control" id="name" placeholder="Your Name" data-rule="minlen:4" data-msg="Please enter at least 4 chars" />
<div class="validation"></div>
</div>
</div>
<div class="col-md-12 mb-3">
<div class="form-group">
<input type="email" class="form-control" name="email" id="email" placeholder="Your Email" data-rule="email" data-msg="Please enter a valid email" />
<div class="validation"></div>
</div>
</div>
<div class="col-md-12 mb-3">
<div class="form-group">
<textarea class="form-control" name="message" rows="5" data-rule="required" data-msg="Please write something for me" placeholder="Message"></textarea>
<div class="validation"></div>
</div>
</div>
<div class="col-md-12">
<input type="submit" name="submit" class="button button-a button-big button-rouded" value="Send Message">
</div>
</div>
</form>