html5 - Sendmail PHP not working - Go Daddy Hosting -
i think straightforward, reason it's not working. see problem code? if not, i'm guessing it's hosting that's issue.
here's code:
html
<form action="sendmail.php" name="form1" method="post"> <input name="hidsubmit" type="hidden" value="true" id="hidsubmit" /> <input type="text" placeholder="your name" name="txtname" required><br> <input type="email" placeholder="email address" name="txtemail" required><br> <input type="number" placeholder="phone number" name="txtphone"><br> <button type="submit" value="submit" class="butt"><strong>submit</strong></button> </form>
php
<?php //check whether submission made if(isset($_post["hidsubmit"])){ //msg body $txtmsg = "enquiry website name : ".$_post["txtname"]." email: ".$_post["txtemail"]." phone: ".$_post["txtphone"]." "; //declarate necessary variables $mail_to = "info@insidemarketstrategy.com"; $mail_from= "admin@insidemarketstrategy.com"; $mail_sub="inquiry insidemarketstrategy.com website"; $mail_mesg=$txtmsg; $headers = "from: admin@insidemarketstrategy.com\r\n" . "x-mailer: php" . "content-type: text/html; charset=iso-8859-1\r\n"; //check success/failure of delivery if(mail($mail_to,$mail_sub,$mail_mesg,$headers)) echo "<div class='alert alert-success alert-dismissable' id='alertmsg'> <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button> <h3>thank !<br><br><span>we in touch soon</span></h3> </div>"; else echo "<div class='alert alert-danger alert-dismissable'><center><span class='textred' align='center'><b>failed send e-mail $mail_sub $mail_to</b></span></center></div>"; } echo ("<meta http-equiv='refresh' content='5 ;url=index.html'>"); ?>
Comments
Post a Comment