手机
当前位置:查字典教程网 >操作系统 >Windows系列 >解决windows系统下php.ini邮件配置正确不发送邮件的问题
解决windows系统下php.ini邮件配置正确不发送邮件的问题
摘要:Warning:mail()[function.mail]:SMTPserverresponse:5305.7.0MustissueaSTA...

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:phpsendmail,最好短路径,长路径名有可能产生问题。

3.修改php.ini如下

sendmail_path = "C:wampsendmailsendmail.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 = 4u4v@163.com

; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).

sendmail_path = “D:xamppsendmailsendmail.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

force_sender=yourusername@163.com

sendmail网上有下的,如果你是用xampp,那里面直接就带了。

同时在虚拟主机的conf里加上这样一句

php_admin_value sendmail_path ‘D:xamppsendmailsendmail.exe -t 4u4v@163.com’

此邮件地址为用户的邮件地址,随便添。

【解决windows系统下php.ini邮件配置正确不发送邮件的问题】相关文章:

windowsxp系统下让文件以详细信息方式显示的方法

Win10系统下皮皮播放器出现闪退的原因及解决方法

win10系统下打开office2013会提示配置进度的解决方法

Win10忘记登录密码怎么使用Windows系统U盘/光盘重置密码?

解决WinXP系统Internet Explorerr脚本错误问题的方法

win10系统中怎么设置打印纸张的大小?

Win10系统重置功能的快速开启方法

win10系统取消代理服务器的方法

Win7系统如何使用电子邮件申请Microsoft账号

解决Win7系统提示调查路由器或访问点问题的方法

精品推荐
分类导航