关于EMAIL函数的使用方法。

完全按照PHP手册上的说明使用。

 1   
 2  
 3$to = "[email protected]";   
 4$title = "a mail";   
 5$message = "it is a mail";   
 6  
 7$headers = "From: tevezl@$SERVER_NAME\r\n";   
 8  
 9$headers .= "Cc: vicentw@$SERVER_NAME\r\n";   
10  
11  
12mail($to,$title,$message,$headers);   
13  

但是有警告]
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Apache2\htdocs\test.php on line 14

为什么啊?高手赐教
---------------------------------------------------------------

啥操作系统?用mail函数要sendmail软件
---------------------------------------------------------------

你没有配sendmail,mail函数需要sendmail支持,windows你配置一下smtp服务

Published At
Categories with Web编程
Tagged with
comments powered by Disqus