在linux上,我写一个测试mail程序:
[PHP]
<?php
$to = "ljcao@21cn.com";
/* subject */
$subject = "Test mail @ ".date("Y-m-d H:i:s");
/* message */
$message = "
".$subject."
Here are the birthdays upcoming in August! @ ".date("Y-m-d H:i:s")."
| Person | Day | Month | Year |
| Joe | 3rd | August | 1970 |
| Sally | 17th | August | 1973 |
";
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=??????\r\n";
/* additional headers */
$headers .= "From: wwa \r\n";
$headers .= "Cc: wwa@hanweb.com\r\n";
$headers .= "Bcc: wwa@hanweb.com\r\n";
/* and now mail it */
if(mail($to, $subject, $message, $headers)) echo "Send Ok"; else echo "Send Fail";
?>
[/PHP]
程序执行都是OK的,但是mail没有发出去去,后来到mail的queue目录里一看,有n个邮件在等待,所有肯定sendmail出问题了,就把mail系统卸载了。
后来找网管把mail重装了高一点的版本,mail是发出去了,可是就是不支持HTML mail 了,以前的版本是支持的。现在的版本好象不认识前面的MIME头了,直接把头也当成内容了,晕!
请问一下,这是怎么回事?是不是mail版本升级了,mime头也跟着升级了?
请指点一下。