我创建了一个联系页面,但是当我通过向网站的电子邮件地址(gmail 地址)发送电子邮件来测试它时,它显示一个白色页面
这是我的联系表单的 php 代码
<?php
if (isset ($_POST['submit'])) {
$name = $_POST ['name'];
$mailFrom = $_POST ['email'];
$message = $_POST ['message'];
$mailto = "lawsafrica@gmail.com";
$headers = "From: ".$mailFrom;
$txt = "You have received an e-mail from ".$name.".\n\n".$message;
mail($mailTo, $txt, $headers);
header ("Location: Contact.html?mailsend");
}
这是我的 html 代码 (contact.html)
<section class="box1">
<h2>Contact us</h2>
<div class="lines"></div>
<form class="contact-form" action="contactform.php" method= "POST">
<input type= "text" class= "contact-form-text" placeholder="Your name" required>
<input type= "Email" class= "contact-form-text" placeholder="Your email"required>
<textarea class="contact-form-text" placeholder="Your message"required></textarea>
<input type="submit" class="contact-form-btn"value="Send">
</form>
</section>
<section class= "box2">
<h3>Didn't find what you are looking for?</h3>
<div class="lines"></div>
<form class="contact-form" action="contactform.php" method= "POST" >
<input type= "text" name= "name" class= "contact-form-text" placeholder="Your name"required>
<input type= "Email" name= "email" class= "contact-form-text" placeholder="Your email"required>
<textarea class="contact-form-text" name= "message" placeholder="Type what are you looking for"required></textarea>
<input type="submit" name= "submit" class="contact-form-btn"value="Send">
</form>
</section>
<section class= "box3">
<h4>Become a contributor</h4>
<div class="lines"></div>
<form class="contact-form" action="uploads.php" method= "POST" enctype= "multipart/form-data">
<input type= "file" class= "contact-form-text" >
<button type="submit" class="contact-form-btn" name= "submit">Upload</button>
</form>
</section>
德玛西亚99