windows server2003 sendmail 安装 配置_外贸培训_莆田外贸-莆田外贸培训 - Powered by Discuz! Archiver

admin 发表于 2016-5-19 19:11:33

windows server2003 sendmail 安装 配置

sendmail安装 检查有没有sendmail程序,在xampp安装目录下的sendmail文件夹下。没有则下载sendmail.zip,然后把它解压到如D:/php/sendmail/目录下。配置步骤:1.php.ini中如下设置:; SMTP = localhost; smtp_port = 25;sendmail_from = sendmail_path = "C:/xampp/sendmail/sendmail.exe -t"也就是注释掉"SMTP"、"smtp_port"、"sendmail_from",设置sendmail_path变量的值为以上所示(根据自己电脑上sendmail.exe的目录自行设置)。
2.sendmail.ini中如下设置smtp_server=smtp.gmail.comsmtp_port=587smtp_ssl=TLSerror_logfile=error.logdebug_logfile=debug.logauth_username=user@gail.comauth_password=passwd

给予cmd.exe权限
C:/WINDOWS/system32/cmd.exe 文件以 users的读权限。不给予权限会出现以下错误。
Warning: mail() : Could not execute mail delivery program

测试代码:
<?php
$mail = “xxxx@sina.com.cn”;
$subject = “Mail Test”;
$text = “This is a test mail for function mail()”;if(mail($mail,$subject,$text)){
echo “email send success!”;
}else{
echo “email send fail!”;
}
?>
页: [1]
查看完整版本: windows server2003 sendmail 安装 配置

莆田百姓论坛·免责声明
本站提供网上自由讨论使用,所有个人言论并不代表本站立场,与本站立场无关,本站不会对其內容负任何责任。
本站内容均经过严格审查筛选,内容健康,如发现违反国家法律法规的內容,请立即联系我们,我们立刻从网站上删除,并致以最深的歉意。