如何在Windows系统配置sendmail使用PHP的mail函数
思韵闪耀
2013-03-18
0
注意:如果不是自己的服务器的话用其他方法发吧,方法多得是!

mail函数在win里可以通过配置php.ini来正常使用
打开php.ini
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
sendmail_from = me@example.com
; For Unix only.  You may supply arguments as well (default: ”sendmail -t -i”).
; sendmail_path = ”"
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =
设置SMTP,smtp_port,sendmail_from。分别是pop3服务器地址,端口号这两个一般默认,sendmail_from设置的是发件人邮箱
注意的是这里需要的pop3服务器是不需要身份验证的那种而且不能使用安全方式连接的。国内有些没有提供不验证服务的…在服务器上装上smtp组件就可以了,安装方法很多网上都有
如果不打算让本机成为smtp服务器,可以使用linux常用的sendmail,这样可以通过验证使用国内的一些服务器的pop3服务器,建议是qq或者foxmail个人感觉腾讯的速度和稳定都不错。
经测试目前163、新浪的SMTP无法使用,qq和foxmail可以用,其他没测试…

win下怎么配置呢
[mail function]
; For Win32 only.
; SMTP = localhost
; smtp_port = 25
; For Win32 only.
; sendmail_from = me@example.com
; For Unix only.  You may supply arguments as well (default: ”sendmail -t -i”).
sendmail_path = ”d:/soft/sendmail/sendmail.exe -t -i”
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

按上面的方式把前面说的三个选项前面都加上分号,把sendmail_path前面的分号去掉下载下面的文件:
sendmail压缩包
http://upload.13sy.com/file/20131023/1-13102311152D32.rar

解压后找个地方放好,将里面sendmail.exe的地址填到sendmail_path并如上面所写增加-t -i参数(更多参数自己查吧)。
打开:sendmail.ini文件
修改里面的
smtp_server=smtp服务器地址
auth_username=邮箱登录名
auth_password=邮箱密码
force_sender=发件人地址全写
ok了mail函数可以正常使用了,注意如果iis使用cgi模式运行php的话用sendmail方法会出错,修改为ISAPI模式后一切正常了。
如果不是自己的服务器的话用其他方法发吧,方法多得是!


【版权声明】
本站部分内容来源于互联网,本站不拥有所有权,不承担相关法律责任。如果发现本站有侵权的内容,欢迎发送邮件至masing@13sy.com 举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。

相关内容

将IIS设置克隆到新服务器...
将IIS设置克隆到新服务器的最佳方法是使用IIS配置文件。以下是详...
2025-06-06
网页保护、网页图片保护
1、禁止另存网页,把如下代码加入到网页body/body中 程序代...
2025-05-30
搭建Git服务器及本机克隆...
Git是什么?Git是目前世界上最先进的分布式版本控制系统。SVN...
2025-03-17
ubuntu环境下搭建gi...
操作环境:服务器:Ubuntu 24.04.2 LTS+git 2...
2025-03-17
Linux系统挂载未分配硬...
先查看未挂载之前的磁盘使用情况发现磁盘使用率已经达到了96%,迫切...
2025-02-22
Linux lsblk 命...
简介Linux 中的 lsblk 命令,全称叫做:list blo...
2025-02-22

热门资讯

Discus X论坛配置sen... Discuz x2.5 后台邮件设置方法其实和X2/x1.5基本一样,但很多同学都不注意一些细节,比...
redhat Linux系统配... 1 .检查Send Mail 的安装包 [root@sql root]# rpm -qa | gre...
使用Sendmail的反垃圾邮... 在最近几年,无处不在的垃圾邮件已使得所有邮件箱不堪重负,不断地需要工具以抗击这一无穷尽的垃圾邮件流。...