解决windows系统下php.ini邮件配置正确不发送邮件的问题
php  /  管理员 发布于 7年前   257
Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first
php mail()函数在windows不能用,需要安装sendmail
1.从http://glob.com.au/sendmail/下载sendmail.zip
2.解压到C:下,例如C:\php\sendmail,最好短路径,长路径名有可能产生问题。
3.修改php.ini如下
sendmail_path = "C:\wamp\sendmail\sendmail.exe -t"
4.根据你自己的配置环境修改sendmail.ini。
第一次最好启用debug.log_file,error_logfile,以查看sendmail是否生效。
5.重启apache
用sendmail结合其它的smtp服务器,如smtp.163.com来实现发邮件。现在大部分邮箱都要求smtp验证,所以要在sendmail.ini中加入用户名和密码。
php.ini配置 (以用163邮箱为例)
复制代码代码如下:
[mail function]
; For Win32 only.
SMTP = smtp.163.com
smtp_port = 25
; For Win32 ……
用sendmail结合其它的smtp服务器,如smtp.163.com来实现发邮件。现在大部分邮箱都要求smtp验证,所以要在sendmail.ini中加入用户名和密码。
php.ini配置 (以用163邮箱为例)
复制代码代码如下:
[mail function]
; For Win32 only.
SMTP = smtp.163.com
smtp_port = 25
; For Win32 only.
sendmail_from = [email protected]
; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
sendmail_path = “D:\xampp\sendmail\sendmail.exe -t”
就配置三项,smtp、smtp_port和sendmail_path
sendmail.ini配置
复制代码代码如下:
[sendmail]
; you must change mail.mydomain.com to your smtp server
smtp_server=smtp.163.com
smtp_port=25
auth_username=yourusername
auth_password=yourpassword
[email protected]
sendmail网上有下的,如果你是用xampp,那里面直接就带了。
同时在虚拟主机的conf里加上这样一句
复制代码代码如下:
php_admin_value sendmail_path ‘D:\xampp\sendmail\sendmail.exe -t [email protected]’
此邮件地址为用户的邮件地址,随便添。
122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号