好的,这正是我的问题。 我有一个html表单,位于我网站的页面上。 然后我将mail.php放在同一目录中。
表单在提交表单时发送邮件,这不是问题,但是它发送的邮件不完整。
这是html代码
<form name="contactform" form action="mail.php" method="post"
class="w3_form_post">
<div class="w3_agileits_main_grid w3l_main_grid">
<div class="agileits_grid">
<h5>Name * </h5>
<div class="nam">
<input type="text" name="name" placeholder="First
Name" required="yes">
</div>
<div class="nam1">
<input type="text" name="surname" placeholder="Last
Name" required="yes">
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="w3_agileits_main_grid w3l_main_grid">
<div class="agileits_grid">
<h5>Phone No: </h5>
<input type="phone" name="phone" placeholder="ex :
082 123 4567" required="yes">
</div>
<div class="agileits_grid">
<h5>E-mail </h5>
<input type="email" name="email" placeholder="ex :
myname@gmail.com" required="no">
</div>
</div>
<div class="agileits_w3layouts_main_grid w3ls_main_grid">
<div class="agileinfo_grid">
<h5>Preferred time to call</h5>
<div class="agileits_w3layouts_main_gridl">
<input class="date" id="datepicker" name="date"
type="text" value="mm/dd/yyyy" onfocus="this.value = '';" onblur="if
(this.value == '') {this.value = '08/13/2016';}" required="">
</div>
<div class="agileits_w3layouts_main_gridr">
<input type="time" name="time" required="">
</div>
<div class="clearfix"> </div>
</div>
</div>
<div class="agileits_w3layouts_main_grid w3ls_main_grid">
</div>
<div class="agileinfo_main_grid">
</div>
<div class="w3_main_grid">
<div class="w3_main_grid_right">
<input type="submit" value="Send">
</div>
<div class="clearfix"> </div>
</div>
</form>
我知道那里有css引用。 我的页面上也有js。
这是mail.php
<?php
$ToEmail = 'equilibrium3.shaneel@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 = "Surname: ".$_POST["surname"]."";
$MESSAGE_BODY = "Phone: ".$_POST["phone"]."";
$MESSAGE_BODY = "Date: ".$_POST["date"]."";
$MESSAGE_BODY = "Time to call: ".$_POST["time"]."";
$MESSAGE_BODY .= "Email: ".$_POST["email"]."";
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure");
\n\n
?>
这是电子邮件的回复
Time to call: Email:
发件人字段中也没有发件人。 我在提交表单时已正确输入所有字段。
答案 0 :(得分:2)
Extent == std::dynamic_extent
用
替换此代码$MESSAGE_BODY = "Name: ".$_POST["name"]."";
$MESSAGE_BODY = "Surname: ".$_POST["surname"]."";
$MESSAGE_BODY = "Phone: ".$_POST["phone"]."";
$MESSAGE_BODY = "Date: ".$_POST["date"]."";
$MESSAGE_BODY = "Time to call: ".$_POST["time"]."";
$MESSAGE_BODY .= "Email: ".$_POST["email"]."";