立即注册 找回密码

QQ登录

只需一步,快速开始

查看: 4303|回复: 0

[Windows系统教程] iis下php mail函数的sendmail配置方法(官方推荐)

[复制链接]
发表于 2015-4-18 11:24:12 | 显示全部楼层 |阅读模式
道勤网-数据www.daoqin.net

亲注册登录道勤网-可以查看更多帖子内容哦!(包涵精彩图片、文字详情等)请您及时注册登录-www.daoqin.net

您需要 登录 才可以下载或查看,没有账号?立即注册

x
很多玩discuz的彭友在使用在线发邮件的功能,但是测试了"通过 PHP 函数的 sendmail 发送(推荐此方式)"怎么都没用,因为本人现在用的是iis+php环境,所以就出这么一个教程,教大家在自己服务器上配置sendmail
首先你需要先到从http://glob.com.au/sendmail/下载sendmail.zip文件,点此可以直接下载噢,然后把它解压到如D:\php\sendmail\目录下。

然后打开php.ini文件,找到下面这段代码


  1. [mail function]
  2. ; For Win32 only.
  3. SMTP = localhost
  4. smtp_port = 25
  5. ; For Win32 only.
  6. ;sendmail_from = me@example.com
  7. ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
  8. ; sendmail_path = ""
  9. ; Force the addition of the specified parameters to be passed as extra parameters
  10. ; to the sendmail binary. These parameters will always replace the value of
  11. ; the 5th parameter to mail(), even in safe mode.
  12. ;mail.force_extra_parameters =
复制代码
默认情况下是以本机做为邮件服务器,这里我们需要借用sendmail来发送邮件,用sendmail来配置如用qq、163的邮箱来发送(一般都是以这种方式)所以我们需要把所有的选项都注销,即把SMTP = localhost和smtp_port = 25前面加上";"然后把sendmai_path=""前面的";"删掉,改为sendmai_path="d:\php\sendmail\sendmail.exe -t",改完后的即是


  1. [mail function]
  2. ; For Win32 only.
  3. ;SMTP = localhost
  4. ;smtp_port = 25
  5. ; For Win32 only.
  6. ;sendmail_from = me@example.com
  7. ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
  8. sendmail_path = "d:\php\sendmail\sendmail.exe -t"
  9. ; Force the addition of the specified parameters to be passed as extra parameters
  10. ; to the sendmail binary. These parameters will always replace the value of
  11. ; the 5th parameter to mail(), even in safe mode.
  12. ;mail.force_extra_parameters =
复制代码
注意以上只需要开启sendmail_path即可,然后保存

接着修改sendmail目录下的sendmail.ini文件,主要填的内容有以下几项

  1. smtp_server=smtp服务器地址(如 smtp.ym.163.com)
  2. auth_username=邮箱登录名(如 info@xxxx.com)
  3. auth_password=邮箱密码(如 xxxxxx)
  4. force_sender=发件人地址全写(如 info@xxxx.com)
复制代码
另外还有一项

  1. ; auto = use SSL for port 465, otherwise try to use TLS
复制代码
把前面的";"删除,即开启SSL安全登录选项即可

以上四项正确填写修改完成后保存,然后重启IIS即可正常使用。

如果不能发送邮件,检查下端口是不是被屏蔽了,mcafee是不是设置了禁止发送邮件等



道勤主机提供365天*24小时全年全天无休、实时在线、零等待的售后技术支持。竭力为您免费处理您在使用道勤主机过程中所遇到的一切问题! 如果您是道勤主机用户,那么您可以通过QQ【792472177】、售后QQ【59133755】、旺旺【诠释意念】、微信:q792472177免费电话、后台提交工单这些方式联系道勤主机客服! 如果您不是我们的客户也没问题,点击页面最右边的企业QQ在线咨询图标联系我们并购买后,我们为您免费进行无缝搬家服务,让您享受网站零访问延迟的迁移到道勤主机的服务!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

道勤网- 推荐内容!上一条 /2 下一条

!jz_fbzt! !jz_sgzt! !jz_xgzt! 快速回复 !jz_fhlb! !jz_lxwm! !jz_gfqqq!

关于我们|手机版|小黑屋|地图|【道勤网】-www.daoqin.net 软件视频自学教程|免费教程|自学电脑|3D教程|平面教程|影视动画教程|办公教程|机械设计教程|网站设计教程【道勤网】 ( 皖ICP备15000319号-1 )

GMT+8, 2024-5-9 10:29

Powered by DaoQin! X3.4 © 2016-2063 Dao Qin & 道勤科技

快速回复 返回顶部 返回列表