http://webprojects.co/dev_wed/mail.php試圖使用該腳本從服務器發送郵件,但我沒有能夠從服務器發送郵件無法使用PHP的mail發送郵件()函數
<?php
$to = "[email protected]";
$subject = "HTML email";
$message = "
<html>
<head>
<title>HTML email</title>
</head>
<body>
<p>This email contains HTML Tags!</p>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
</table>
</body>
</html>
";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: <[email protected]>' . "\r\n";
$headers .= 'Cc: [email protected]' . "\r\n";
$result = mail($to,$subject,$message,$headers);
if(!$result) {
echo "Error";
} else {
echo "Success";
}
?>
你有沒有試過尋找更多的細節,如「錯誤」的確切原因? – emaillenin
我已經嘗試過但沒有得出任何結論。你可以提出任何方法來找到確切的問題@emaillenin –