我想通过PHP发送HTML邮件,但我似乎无法得到它的工作。PHP发送HTML邮件
这是我的代码:
// multiple recipients
$to = 'mail';
// subject
$subject = 'Subject';
// message
$message = "
<html>
<head>
<title>Thanks</title>
</head>
<body>
<div>
<b>Thanks for your email</b>
</div>
</body>
</html>
";
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: info <[email protected]>' . "\r\n";
$headers .= 'From: Pynix <[email protected]>' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
这也没有表现出任何发件人当我收到它在Outlook中。
任何想法?
感谢
看看这里和其他相关的HTML电子邮件的答案http://stackoverflow.com/questions/3058897/sending-html-email-from-php –
是sendmail或安装的东西? – Sparky
@Sparky:sendmail肯定是安装的。 OP说:“当我在Outlook中收到它时”。所以,一定有什么问题......这段代码似乎直接取自PHP.net网站。 –