[转]php mail函数在win下的使用,以及配置win下的sendmail
2010-06-15 10:12
513 查看
注意:如果不是自己的服务器的话用其他方法发吧,方法多得是!
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.ini文件
修改里面的
smtp_server=smtp服务器地址
auth_username=邮箱登录名
auth_password=邮箱密码
force_sender=发件人地址全写
ok了mail函数可以正常使用了,注意如果iis使用cgi模式运行php的话用sendmail方法会出错,修改为ISAPI模式后一切正常了。
如果不是自己的服务器的话用其他方法发吧,方法多得是!
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压缩包
解压后找个地方放好,将里面sendmail.exe的地址填到sendmail_path并如上面所写增加-t -i参数(更多参数自己查吧)。打开:sendmail.ini文件
修改里面的
smtp_server=smtp服务器地址
auth_username=邮箱登录名
auth_password=邮箱密码
force_sender=发件人地址全写
ok了mail函数可以正常使用了,注意如果iis使用cgi模式运行php的话用sendmail方法会出错,修改为ISAPI模式后一切正常了。
如果不是自己的服务器的话用其他方法发吧,方法多得是!
相关文章推荐
- [转]php mail函数在win下的使用,以及配置win下的sendmail
- linux Busybox 使用自带sendmail发送邮件以及php mail函数相应配置
- windows下配置sendmail,可以通过PHP mail() 函数发送邮件
- PHP mail()函数使用及配置方法
- Windows下wamp sever+sendmail使用mail()函数时的配置
- PHP mail()函数使用及配置方法
- GNU 的入口和出口配置函数的使用以及函数调用栈追踪
- 如何在Windows系统中安装sendmail使用PHP mail()函数?
- eclipse Maven配置以及使用方法
- 在 vue-cli 脚手架中引用 jQuery、bootstrap 以及使用 sass、less 编写 css [vue-cli配置入门]
- [Java 8] (10) 使用Lambda完成函数组合,Map-Reduce以及并行化
- eclipse Maven配置以及使用方法
- EFM32在使用IAR开发环境配置ICf文件以及指定程序存储地址空间
- socket使用TCP协议时,send、recv函数解析以及TCP连接关闭的问题
- Qt简介以及如何配置Qt使用VS2010进行开发
- C/C++:函数的编译方式与调用约定以及extern “C”的使用
- docker学习(2) mac中docker-machine使用vmware fusion以及配置国内镜像加速
- FCKeditor HTML在线编辑器的使用以及配置
- eclipse的jocky的配置以及使用