我的郵件功能在在線服務器上。它工作正常。但是不是現在。我很困惑它爲什麼停止發送郵件。它顯示發送電子郵件的消息,但收件箱中未收到電子郵件。PHP郵件功能在我的服務器上不工作?
這裏是我的PHP代碼:
<?php
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$message = $_POST['message'];
$headers = "From: " . $email . "\n"; //from address
$to = ""; //my mail id
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \n";
$subject = "Test mail";
$body = '<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>"."<h3>"."Hello Test,."</h3>".
</title>
</head>
<body><p></p>
<p style="color: #00CC66; font-weight:600; font-style:italic; font-size:14px; float:left; margin-left:7px;">You have received an inquiry from your website. Please review the contact information below.
:</p>';
if (mail($to, $subject, $body, $headers)) {
?>
<h3 style="color:#d96922; font-weight:bold; height:0px; margin-top:1px;">Thank You For Contacting us!!</h3>
<?php
} else {
print_r(error_get_last());
}
}
這有什麼錯呢?請幫我找出解決方案。還幫我回應錯誤?
無法在任何地方找到您的「郵件()」代碼.... –
您的郵件功能在哪裏? – Jenz
我更新的代碼,請幫我解決這個問題..這是非常迫切的.. –