html - PHP Contact Form, not sending email -
this question has answer here:
i have been trying make first contact form , after hours of googling can't seem find error in code why it's not working.
my php code:
<?php $to = 'llavert@gmail.com'; $from = strip_tags($_post['email']); $name = strip_tags($_post['name']); $adress = strip_tags($_post['address']); $city = strip_tags($_post['city']); $subject = strip_tags($_post["subject"]); $message = strip_tags($_post['message']); $header = "from: noreply@example.com\r\n"; $header.= "mime-version: 1.0\r\n"; $header.= "content-type: text/html; charset=iso-8859-1\r\n"; $header.= "x-priority: 1\r\n"; mail($to, $subject, $message, $header); print_r(error_get_last());
?>
my html form:
<form method="post" action="mailer.php"> <input type="text" class="col-md-13 col-xs-12 name" name='name' placeholder='naam *'/> <input type="text" class="col-md-13 col-xs-12 email" name='email' placeholder='email *'/> <input type="text" class="col-md-13 col-xs-12 name" name='address' placeholder='straat en huisnummer *'/> <input type="text" class="col-md-13 col-xs-12 email" name='city' placeholder='postcode en gemeente *'/> <input type="text" class="col-md-12 col-xs-12 subject" name='subject' placeholder='onderwerp *'/> <textarea type="text" class="col-md-12 col-xs-12 message" name='message' placeholder='bericht aan bds bvba *'></textarea> <div class="cbtn col-xs-12"> <ul> <li class="clear"><a href="#"><i class="fa fa-times"></i>formulier legen</a></li> <li class="send" name="submit" type="submit" value="send"><i class="fa fa-share"></i>bericht sturen</a></li> </ul> <br><br><br><br><br><br><br><br><br> </div> </form>
from manual
it important note because mail accepted delivery, not mean mail reach intended destination.
it local mail server not set correctly.
Comments
Post a Comment