我試圖使用PHP郵件功能它工作良好,下面的代碼來發送郵件發送郵件:無法從服務器usiong PHP的郵件以HTML格式
<?php
$to = "[email protected]";
$subject = "subject";
$password="xxxxx";
$message = "
<html>
<head>
<title>HTML email</title>
</head>
<body >
<div style='width:670px;height:450px;padding:50px;background-color:#EFEFEB;'>
<div style='width:600px;height:450px;background-color:#FFFFFF;color:#105b94;font-size:20px;padding:10px'>
<img src='http://www.example.com/Images/Index/Logo.png' />
<p>Hi,</p>
<table style='color:#105b94;font-size:20px;'>
<tr>
<td><p>Thank you for registering with us.</p></td>
</tr>
<tr>
<td><br>Your password is :$password<br><br>We appreciate your interest.
</td>
</tr>
<tr>
<td><hr>Contact Us <br>Office :9999999999<br>www.example.com
</td>
</tr>
</table>
</div>
</div>
</body>
</html>
";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From: Support <[email protected]>' . "\r\n";
mail($to,$subject,$message,$headers);
?>
代碼工作好,如果我刪除www.example。 com從上面的代碼行「辦公室:9999999999
www.example.com」請幫助我。
如果不這樣做遠程www.example.com – justrohu 2014-09-22 09:56:01
代碼爲我工作很好,你可以請你的郵件服務器的配置 – Prasad 2014-09-22 09:57:34
所以,你要發送的電子郵件直播從它扔了什麼錯誤(可能是假的)電子郵件'example.com'?你有沒有試過一個真正的?這些信息對於所有電子郵件服務都很重要 – 2014-09-22 10:03:40