所以我正在为我的网站测试邮件消息以进行客户评论。我给自己发了大约20封邮件来检查格式并确保它做得很好。我收到了所有测试的电子邮件,一切顺利。
但是突然间,没有发送任何电子邮件,我无处可去,我真的很恐慌。
这是我的代码:
if(isset($_POST['submit'])){
$to = "mo.merhi01@lau.edu";
$from = $_POST['email'];
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$subject = "Seeker Feedback and Review";
$subject2 = "Copy of your form submission";
$message2 = "Here is a copy of your message " . $_POST['id'] . "\n\n" . $_POST['message'];
$headers = "From:" . $from;
$headers2 = "To:" . $to;
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From:". $from . "\r\n" .
"Reply-To: ".$to . "\r\n" .
"X-Mailer: PHP/" . phpversion();
$message = '<html><body>';
$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td><strong>Seeker UsernameName:</strong> </td><td>" . strip_tags($_POST['id']) . "</td></tr>";
$message .= "<tr style='background: #eee;'><td><strong>Seeker Name:</strong> </td><td>" . strip_tags($_POST['id1']) . "</td></tr>";
$message .= "<tr><td><strong>Provider's First Name</strong> </td><td>" . strip_tags($_POST['first_name']) . "</td></tr>";
$message .= "<tr><td><strong>Title of the Service reviewed</strong> </td><td>" . $title. "</td></tr>";
$message .= "<tr><td><strong>Type of the Service:</strong> </td><td>" . $type . "</td></tr>";
$message .= "<tr><td><strong>Description of the Service:</strong> </td><td>" . $description . "</td></tr>";
$message .= "<tr><td><strong>Date Started</strong> </td><td>" . $date_from . "</td></tr>";
$message .= "<tr><td><strong>Date Due</strong> </td><td>" . $date_to . "</td></tr>";
$message .= "<tr><td><strong>Review</strong> </td><td>" . $_POST['message'] . "</td></tr>";
$message .= "</table>";
$message .= "</body></html>";
mail($to,$subject,$message,$headers);
mail($from,$subject2,$message2,$headers2); // sends a copy of the message to the sender
echo "Mail Sent. Thank you " . $_POST['id1'] . ", we will contact you shortly.";
}
?>
我通过回显所有变量测试了那里的所有变量,html中的表格完美运行(我测试过它们)它们都非常好并且没有空变量!帮助,可能发生了什么?