PHP 用mail()发邮件始终不成功。
<?php<br><br>$to = "[email protected]";<br>$subject = "Test mail";<br>$message = "Hello! This is a simple email message.";<br>$from = "[email protected]";<br>$headers = "From: $from";<br>$send=mail($to,$subject,$message,$headers);<br>if($send)<br>echo "Mail Sent";<br>else <br>echo "Sorry,mail sent failed!"<br><br>?>
开发环境用的wamp,下载并安装好了sendmail程序,按网上的说法也改好了php.ini和sendmail.ini
使用foxmail 7.1创建了自己qq邮箱的账户,开启了pop3/smtp服务。更改发件服务器为pop3,使用和收件服务器相同的身份验证。结果还是报错:warning: mail(): smtp server response: 503 error: need ehlo and auth first ! in f:\php\wamp\www\mail.php on line 8
不知道哪个地方不对,请会的人指教下。谢谢!!!










