联系人表格数据未发送到所需的电子邮件

时间:2019-02-09 12:01:18

标签: php mysqli

我的表格有问题。当我单击“提交”按钮时,表单数据未发送到所需的电子邮件。您能检查一下我的代码,弄清楚我在代码中可能犯什么错误。谢谢

    <form class="contact-form" method="post" action="#">
    <!--Input columns-->
    <div class="input-columns clearfix">

            <div class="column1">
                <div class="column-inner">
    <input type="text" placeholder="Name" value="" id="name" name="name">
        </div>
            </div>

        <!--Column-->
  <div class="column2">
   <div class="column-inner">
    <input type="text" placeholder="Email" value="" id="email" name="email">
</div>
   </div>
    <!--End column-->
   </div>
   <!--End input columns-->

<input type="text" placeholder="Subject" value="" id="subject" name="subject">
   <textarea name="message" placeholder="Message" id="message" cols="45" rows="10"></textarea>
   <input type="submit" name="submit" value="send your email" class="but opc-2 submit">
            </form>

   <?php
                                                    if(isset($_POST["submit"])){
                                                     $admin_email="admin@domain.com";
                                                     $user_name=$_POST['name'];
                                                     $user_email=$_POST['email'];
                                                     $user_subject=$_POST['subject'];
                                                     $user_message=$_POST['message'];

                                                    mail($admin_email, $user_name , $user_email, $user_subject, $user_message);

                                                     echo "Your mail has been sent successfuly ! Thank you for your feedback";


                                                    }


                                                    ?>

0 个答案:

没有答案