html - PHP form not receiving email -
i wanted add php form sends message name , email of 1 sent it, current html, btw use bootstrap:
<div class="row" id="contact-padding"> <div class="col-md-12 text-center" id="contact-form1"> <form action="mail.php" method="post"> <p></p><br><input type="text" name="name" placeholder="Име" id="forminput"> <p></p><br><input type="text" name="email" placeholder="Поща" id="forminput"> <p></p><br><input type="text" name="phone" placeholder="Телефон" id="forminput"> <p></p><br> <textarea name="message" rows="6" cols="25" placeholder="Запишете съобщението, което искате да изпратите." ></textarea><br/><br> <input type="submit" value="Изпрати" id="send"> <input type="reset" value="Изчисти" id="send"> </form> </div> </div> </div>
this php script use html:
<?php $name = $_post['name']; $email = $_post['email']; $phone = $_post['phone']; $message = $_post['message']; $formcontent=" from: $name \n phone: $phone \n message: $message"; $recipient = "zombaza@abv.bg"; $subject = "contact form"; $mailheader = "from: $email \r\n"; mail($recipient, $subject, $formcontent, $mailheader) or die("error!"); echo "thank you!"; ?>
everytime try send message, opens php file on new page , dont receive email on "zombaza@abv.bg"
i've tried couple of things dont seem work , important finish job if has idea, please share me, thankful!
sending mail notoriously open spam. in case, you're allowing unvalidated content go directly email header: that's asking trouble. need careful white space , newlines.
to project yourself, go trusted mail script/class/library. regularly use swiftmailer (http://swiftmailer.org/) has suitable configuration, error trapping , on.
if need fix own code above, add in standard debugging (check error_reporting , ini_set('display_errors') ) reveal issues in code. put "echo" @ top know you're calling right script etc (the "open in new page" suggests have javascript that's interfering - disable js functions if that's case).
but check inputs before outputting email, databases or html pages.
Comments
Post a Comment