php mail()函数不适用于html页面

php mail()函数不适用于html页面,php,email,Php,Email,在我的网站中,我使用了调用mail_handler.php的邮件表单,它包含邮件函数。但它不工作,也不会回显if-else的任何输出。 我检查了我的网络邮件帐户,确认它是空的。以下是我的表单代码: <div id="form-main" style="height:500px"; action="mail_handler.php"> <div id="form-div"> <form class="form" id="form1">

在我的网站中,我使用了调用mail_handler.php的邮件表单,它包含邮件函数。但它不工作,也不会回显if-else的任何输出。 我检查了我的网络邮件帐户,确认它是空的。以下是我的表单代码:

 <div id="form-main" style="height:500px"; action="mail_handler.php">
 <div id="form-div">
    <form class="form" id="form1">
         <p class="name">
        <input name="name" class="validate[required,custom[onlyLetter],length[0,100]] feedback-input" placeholder="Name" id="name" type="text">
         </p>
        <p class="email">
        <input name="email" class="validate[required,custom[email]] feedback-input" id="email" placeholder="Email" type="text">
         </p>
        <p class="text">
        <textarea name="text" class="validate[required,length[6,300]] feedback-input" id="comment" placeholder="Message"></textarea>
        </p>
     <div class="submit">
    <input id="button-blue" name="Submit" type="submit">
    <div class="ease"></div>
  </div>
</form>
div>
下面是我的php代码,它没有从表单中获取任何值,只是在单击表单提交按钮时检查php邮件功能是否正常工作:

  <?php 
  $to = 'yogi@yogeshkorke.com';
  $message='Hii';
  $mail=mail($to, "Subject: $subject",$message );
 if($mail){
 echo "Thank you for using our mail form";
 }
 else{
     echo "Mail sending failed.";  
     }
 ini_set('display_errors',1);
 ?>

它不会起作用,因为操作不在表单中。我试图指出用户现有表单中缺少的内容。我要突出显示的方法rest是understoodGreat。但你也需要指出,行动应该是形式上的,我不是在抱怨。
use method post or get in your form
collect in variable
<form class="form" action="mail_handler.php" id="form1" method='post'>