1.机子上安装了AA Mail Server软件
2.php.ini上的配置[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25; For Win32 only.
sendmail_from = 127.0.0.1; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =3.test.php代码<?php
$to      = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();mail($to, $subject, $message, $headers);
?> 运行结果:Warning: mail() [function.mail]: SMTP server response: 550 relay sending is rejected ( => [email protected]) in D:\phpnow\htdocs\test.php on line 9这个问题怎么解决?

解决方案 »

  1.   

    访问拒绝错误 你那个都不是真实的email地址能发出去才怪 试试发给同学的email地址
      

  2.   

    不是搭个smtp就能发信的。否则就垃圾邮件满天飞了。现在大部分免费邮箱都检测邮件头信息的,发件人不是你想写啥写啥。
      

  3.   

    这是你自己的SMTP服务器拒绝了你发送。 检查发件人帐号密码是否正确。 另外自己搭的SMTP服务器很容易被认为是垃圾邮件。
      

  4.   

    发邮件用php自带的是可以了。