mail()函数出错的问题
2008-08-01 15:14
141 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>phpinfo</title>
</head>
<body>
<?
$to = "atoat@sina.com";
$subject = "php-Mail";
$msg = "I completely understand SMTP servers now!";
$headers = "From: atoat@163.com/r/nReply-To: atoat@163.com";
mail("$to", "$subject", "$msg", "$headers");
echo "finished!";
?>
</body>
</html>
出现的错误:
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for atoat@sina.com in C:/webserver/htdocs/www/mail.php on line 14
php.ini配置情况
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
sendmail_from = atoat@163.com
已经安装了windows自带的smtp服务
找了好久才发现需要在smtp服务的中继选项中添加本机IP地址
虚拟服务器->属性->访问->中继
选择"仅以下列表"=>"单台计算机"=>添加127.0.0.1的本地地址
程序没有出现问题,但收件箱中没有立即收到信息.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>phpinfo</title>
</head>
<body>
<?
$to = "atoat@sina.com";
$subject = "php-Mail";
$msg = "I completely understand SMTP servers now!";
$headers = "From: atoat@163.com/r/nReply-To: atoat@163.com";
mail("$to", "$subject", "$msg", "$headers");
echo "finished!";
?>
</body>
</html>
出现的错误:
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for atoat@sina.com in C:/webserver/htdocs/www/mail.php on line 14
php.ini配置情况
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
sendmail_from = atoat@163.com
已经安装了windows自带的smtp服务
找了好久才发现需要在smtp服务的中继选项中添加本机IP地址
虚拟服务器->属性->访问->中继
选择"仅以下列表"=>"单台计算机"=>添加127.0.0.1的本地地址
程序没有出现问题,但收件箱中没有立即收到信息.
相关文章推荐
- php的mail()函数出错的问题
- 关于finfo_file函数获取文件mime值验证出错的问题
- 关于System.out.printf()函数 4000 出错问题
- Axure RP Pro - 相关问题 - 使用正则表达式的较验函数在Firefox下出错
- java中g.drawImage(pict, a, b, 50, 50, this);函数出错问题
- ArcGIS——数据库空间SQL(一、oracle中使用sql空间查询及st_astext等函数出错问题)
- PHP的mail()函数发送邮件,其中的html标签未被正常解析的问题
- PHP经验——usort使用函数中调用引用函数的出错问题
- parameter 3 from 'unsigned long (void *)' to 'unsigned long (__stdcall *)VC以类的成员函数作为线程调用函数时易出错问题解决办法
- Keil中Go To Definition Of函数出错问题
- inline函数使用容易导致出错的问题
- libsvm svmtrain函数运行出错问题
- Ubuntu中启用php的mail()函数并解决发送邮件速度慢问题
- Windows 7 下安装Smtp的替代方法可以解决php 的mail()函数报错问题()
- 关于finfo_file函数获取文件mime值验证出错的问题
- 2010-09-03 19:00 Windows 7 下安装Smtp的替代方法可以解决php 的mail()函数报错问题
- toString(T t)函数在.h中出错的问题
- php之mail函数遇到的问题
- XML配置出错导致HTTP404问题:The requested resource (/WebMailSys/Inbox) is not available.
- gethostname()函数出错,但返回success的问题解决