html - My PHP email form isn't emailing -
this question has answer here:
i trying create contact form on website , created email form doesn't email. have tried changing recipient multiple times not seam work. running threw server , return message fine when check email see if have received it, haven't. apreciated.
this html:
<form class="contact-form" action="mail.php" method="post"> <div class="smallcontainer"> <div class="contactleft"> <h6>name</h6> </div> <input class="contact-input" name="name" type="text"></input> </div> <div class="smallcontainer"> <div class="contactleft"> <h6>e-mail</h6> </div> <input class="contact-input" name="email" type="text"></input> </div> <div class="smallcontainer"> <div class="contactleft"> <h6>phone number</h6> </div> <input class="contact-input" name="phone" type="text"></input> </div> <div class="smallcontainer"> <div class="contactleft"> <h6>subject</h6> </div> <input class="contact-input" name="subject" type="text"></input> </div> <div class="smallcontainer"> <div class="contactleft"> <h6>your message</h6> </div> <textarea class="contact-textarea" name="message" rows="6"></textarea> </div> <input class="submit btn btn-default" type="submit" value="send"></input> </form>
this php form:
<?php $name = $_post['name']; $email = $_post['email']; $message = $_post['message']; $formcontent="from: $name \n message: $message"; $recipient = "megatravel15@gmail.com"; $subject = "contact form"; $mailheader = "from: $email \r\n"; mail($recipient, $subject, $formcontent, $mailheader) or die("error!"); echo "thank you!"; ?>
check email configuration in php.ini how configured? if it's configured this:
[mail function] ; setup linux systems sendmail_path = /usr/sbin/sendmail -t sendmail_from = me@myserver.com
check have sendmail installed , working in path.
Comments
Post a Comment