收不到邮件。这让我发疯了,原来的问题,以前只有这个领域。电子邮件、主题、消息。我收到了电子邮件,但我看不到电子邮件变量。它刚从我的服务器进来。所以我无法回复我收到的任何电子邮件。想添加另一个字段。“再次发送电子邮件”,但它说它正在发送电子邮件,而我的收件箱中什么也没收到。这里有什么问题?(注意:出于安全原因,emailfield 已删除)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>testing</title>
<style type="text/css">
body,td,th {
color: #F7F3F3;
}
body {
background-color: #050505;
}
</style>
</head>
<body style="text-align: center">
<?php ?>
<br />
<?php
if (isset($_POST['submit'])){
{
//excute the code
$email = $_POST['email'];
$subject = $_POST['subject'];
$eg = $_POST['eg'];
$message = $_POST['message'];
if (strlen($email) <= 0)
{
echo "You need to enter an email";
}else{
if (strlen($subject) <= 0)
{echo "You need to enter a subject";
}else{
if (strlen($message) <= 0)
{echo "You need to enter a message";
}else{
if (strlen($eg) <= 0)
{echo "Email Again";
}else{
if(filter_var($email, FILTER_VALIDATE_EMAIL) == true){
//continue with code
mail("random@gmail.com", $subject, $message, $eg, "From:$email");
echo "Your message has been sent";
}
else
{
echo "You must fill out the entire form";
}
}
}
}
}
}
}
?>
<br />
<span style="text-align: center">This is the contact form.</span>
<form method="post" action="testing.php">
<table align="center" style="color: #030303;">
<tr><td>Email: <input type="text" name="email" /></td></tr>
<trd><td>Email Again:<input type="text" name="eg" /></td></tr>
<trd><td>Subject:<input type="text" name="subject" /></td></tr>
<trd><td><label for="textarea">Message:</label>
<textarea name="message" cols="40" rows="15">Type your message here.</textarea></tr><tr>
<trd><td><input type="submit" name="submit" value="send" /></td></tr>
</table>
</form>