您现在的位置是:网站首页> 编程资料编程资料
解决windows系统下php.ini邮件配置正确不发送邮件的问题_windows_Windows系列_操作系统_
2024-01-06
141人已围观
简介 解决windows系统下php.ini邮件配置正确不发送邮件的问题_windows_Windows系列_操作系统_
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 = 4u4v@163.com
; 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
force_sender=yourusername@163.com
sendmail网上有下的,如果你是用xampp,那里面直接就带了。
同时在虚拟主机的conf里加上这样一句
php_admin_value sendmail_path ‘D:\xampp\sendmail\sendmail.exe -t 4u4v@163.com’
此邮件地址为用户的邮件地址,随便添。
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 = 4u4v@163.com
; 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
force_sender=yourusername@163.com
sendmail网上有下的,如果你是用xampp,那里面直接就带了。
同时在虚拟主机的conf里加上这样一句
复制代码
代码如下:php_admin_value sendmail_path ‘D:\xampp\sendmail\sendmail.exe -t 4u4v@163.com’
此邮件地址为用户的邮件地址,随便添。
相关内容
- VS2010/2012的运行速度提高策略_windows_Windows系列_操作系统_
- 使用windows防火墙时报错0x80070422解决方案_windows_Windows系列_操作系统_
- 天天富翁萌娃奶爸可儿三人属性介绍_手机游戏_游戏攻略_
- 全民飞机大战不花钱党老玩家千万高分心得攻略_手机游戏_游戏攻略_
- 女神的新衣三大职业详细介绍 女神的新衣三大职业技能玩法攻略_手机游戏_游戏攻略_
- 刀塔传奇猴子站位及属性分析_手机游戏_游戏攻略_
- 秦时明月2伙伴选择那个好 秦时明月2伙伴选择技巧分享_手机游戏_游戏攻略_
- 全民英雄新增宠物得方法及介绍_手机游戏_游戏攻略_
- 三国之刃获取传说装备的方法攻略_手机游戏_游戏攻略_
- 影之刃公测版技能链连招的选择与杀意组合搭配分享_手机游戏_游戏攻略_
