<HTML>
<HEAD>
<TITLE>mail</TITLE>
</HEAD>
<BODY>
<?
    //define who is to receive the mail
    $mailTo = "[email protected]";    //set the subject
    $mailSubject = "Testing Mail";    //build body of the message
    $mailBody = "This is a test of PHP's mail function.";
    $mailBody .= "It was generated by PHP version ";
    $mailBody .= phpversion();    //add a from header
    $mailHeaders = "From: [email protected]\n";
    
    //send mail
    mail($mailTo, $mailSubject, $mailBody, $mailHeaders);
?>
</BODY>
</HTML> 
你必须保证在配置PHP环境时mail()函数没有被屏蔽!  

解决方案 »

  1.   

    http://www.csdn.net/expert/topic/175/175935.shtm
      

  2.   

    楼上的老兄:“你必须保证在配置PHP环境时mail()函数没有被屏蔽!”可以解释一下吗?屏蔽的设置是怎么样的?  
      

  3.   

    php.ini这句
    disable_functions = ; This directive allows you to disable certain改为
    disable_functions =mail()
    mail()就不能用了!当然,[mail function]
    SMTP = localhost ;for win32 only
    sendmail_from = [email protected] ;for win32 only
    ;sendmail_path = ;for unix only, may supply arguments as well (default is 'sendmail -t -i')
    也很重要