dongzhong5573 2019-04-22 18:46
浏览 33

没有错误,但没有通过整个表单脚本来发送电子邮件

Form not sending I have multiple forms on different pages of the site they are all programmed the same. I have 2 though that will not work when every other form works fine. I am attaching code for the short on and seeing any has any idea why the other forms would work but these would not even though programmed identically other then the inputs it is pulling as they are for different forms.

I have tried simplifying code to see where it may be hanging up tried echoing the errors but I get none and so I am at a lose wondering if I am just missing something silly

FORM ON THE PAGE

    <div class="col-md-8 col-lg-9">
                  <form method="post" action="contactprocess.php" `enter code 
                     here`class="form-contact">
                      <div class="row">
                          <div class="col-lg-5">
                              <div class="form-group">
                                  <input class="form-control" name="name" 
    type="text" placeholder="Enter your name" required>
                              </div>
                              <div class="form-group">
                                  <input class="form-control" name="email" 
    type="text" placeholder="Enter email address" required>
                              </div>
                              <div class="form-group">
                                  <input class="form-control" name="subject" 
    type="text" placeholder="Enter Subject">
                              </div>
                          </div>
                          <div class="col-lg-7">
                              <div class="form-group">
                                  <textarea class="form-control different- 
   control w-100" name="textarea" id="textarea" cols="30" rows="6" 
   placeholder="Enter Message"></textarea>
                              </div>
                          </div>
                      </div>
                      <div class="form-group text-center text-md-right">
                          <button type="submit" class="btn active btn-- 
   leftBorder">Send Message</button>
                      </div>
                  </form>

PHP SCRIPT

    <?php

    if (isset($_POST['submit'])){
    $name = $_POST['name'] ;
    $email = $_POST['email'] ;
    $subject = $_POST['subject'] ;
    $textarea = $_POST['textarea'] ;
    $mailto = "xxx@xxxx.com";



    $headers  = 'MIME-Version: 1.0' . "
";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";

    $body =     '<html><body>' ;
    $body .=    "<h1> Contact Form </h1>" ;
    $body .=    '<table rules="all" style="border-color: #666;" 
    cellpadding="10">';
    $body .=    "<tr><td><strong> Name: </strong></td><td>"  .$name . 
    "</td><td><strong> Email: </strong></td><td>"  .$email . "</td></tr>" ;
    $body .=    "<tr><td><strong> Message: </strong></td><td>"  
    .$textarea . "</td></tr>" ;
    $body .=    "</table>" ;
    $body .=    "</body></html>" ;

    mail ($mailto, $subject, $body, $headers) ;
    header ("Location: contactsuccesss.html") ;

    }
    ?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 西门子S7-Graph,S7-300
    • ¥50 用易语言http 访问不了网页
    • ¥50 safari浏览器fetch提交数据后数据丢失问题
    • ¥15 matlab不知道怎么改,求解答!!
    • ¥15 永磁直线电机的电流环pi调不出来
    • ¥15 用stata实现聚类的代码
    • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
    • ¥20 docker里部署springboot项目,访问不到扬声器
    • ¥15 netty整合springboot之后自动重连失效
    • ¥15 悬赏!微信开发者工具报错,求帮改