在第11行少 { 了<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>发送邮件</title>
</head>
<body>
<?php 
    echo "wangyan";
    if($from=="") $from="wu ming:";
    $headers="From:".$from."\n";
if(mail($to,$subject,$text)){
echo "chenggong";
else echo "shi bai";
}
?></body>
</html>

解决方案 »

  1.   

    谢谢:我明白了
    可是我想要在收到的邮件中怎么显示发件人的油箱地址,这样的Mail函数怎么用!
      

  2.   

    $to="[email protected]";  //收件人信箱
    $subject="subject";$headers="From:[email protected]<[email protected]> \r\n";
    $headers.="Mime-Version: 1.0\r\n";
    $headers.="Content-Type: text/html; charset=gb2312; format=flowed\r\n\r\n";$message="信息内容";mail($to, $subject, $message, $headers);