表格未通过电子邮件发送数据

时间:2019-05-12 23:51:18

标签: html forms button

当我提交表格时,我失败了,但是一切看起来都很好。

<form autocomplete="off" id="form" name="form" action="sendemail.php" method="post" enctype="text/plain">
                        <h1 class="lined-heading">Contact me</h1>
                        <p>My name is  
                           <span class="fakeInput"></span>
                           <input autocomplete="off" type="text" name="name" id="personName" maxlength="25" placeholder="Paul" />  
                           and I want  to contact Younes for his 
                           <span class="fakeInput"></span>
                           <input  type="text" autocomplete="off" name="service" id="serviceName" maxlength="25" placeholder="digital marketing" /> 
                           services. Younes can contact me on 
                           <span class="fakeInput"></span>
                           <input  type="text" autocomplete="off" name="phone" id="phoneNumber" maxlength="25" placeholder="+1 (223)222-4432" /> 
                           or on my email which is <span class="fakeInput"></span>
                           <input type="email" autocomplete="off" name="email" id="emailAddress" maxlength="25" placeholder="paul@gmail.com" /> .
                        </p>
                        <button type="submit" name="Submit" value="Send" id="formSubmit" class="animated hover-effect"><span>Say Hello !</span></button> 
                     </form>`<?php 
$ToEmail = 'ydiouri.pro@gmail.com'; 
$EmailSubject = 'Site contact form'; 
$mailheader = "From: ".$_POST["email"]."\r\n"; 
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n"; 
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
$MESSAGE_BODY = "Name: ".$_POST["name"].""; 
$MESSAGE_BODY .= "Email: ".$_POST["email"].""; 
$MESSAGE_BODY .= "Email: ".$_POST["phone"].""; 
$MESSAGE_BODY .= "Comment: ".nl2br($_POST["service"]).""; 
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); 
?>

`

提交表单失败,我认为一切都做得很好,但是每次我得到相同的结果

0 个答案:

没有答案