立即注册 找回密码

QQ登录

只需一步,快速开始

查看: 3062|回复: 0

[Wordpress 通用教程] 如何配置以及实现mail()函数的具体方法

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

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

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

x
总是喜欢用phpmailer插件来实现邮件发送,而从来没有真正的在某个项目中采用php自带的mail()函数来实现发送邮件的功能。今天刚好有项目需要,所以通过php自带的mail()函数来实现项目中需要的发送邮件功能!

下载sendmail


在百度自行搜索sendmail软件

解压安装包(最好和php同一个目录下C:\websoft\)

如何配置以及实现mail()函数的具体方法

如何配置以及实现mail()函数的具体方法

配置php.ini文件

  1. [mail function]
  2. ; For Win32 only.
  3. SMTP = smtp.jhonse.com
  4. smtp_port = 25
  5. ; For Win32 only.
  6. sendmail_from = service@jhonse.com
  7. ; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
  8. sendmail_path = "C:\websoft\sendmail\sendmail.exe -t"
复制代码

如何配置以及实现mail()函数的具体方法02

如何配置以及实现mail()函数的具体方法02

配置sendmail.ini文件

  1. error_logfile=error.log
  2. ; create debug log as debug.log (defaults to same directory as sendmail.exe)
  3. ; uncomment to enable debugging
  4. debug_logfile=debug.log
  5. ; if your smtp server requires authentication, modify the following two lines
  6. auth_username=service@jhonse.com
  7. auth_password=123456
  8. ; if your smtp server uses pop3 before smtp authentication, modify the
  9. ; following three lines.  do not enable unless it is required.
  10. pop3_server=
  11. pop3_username=
  12. pop3_password=
  13. ; force the sender to always be the following email address
  14. ; this will only affect the "MAIL FROM" command, it won't modify
  15. ; the "From: " header of the message content
  16. force_sender=service@jhonse.com
  17. ; force the sender to always be the following email address
  18. ; this will only affect the "RCTP TO" command, it won't modify
  19. ; the "To: " header of the message content
复制代码

如何配置以及实现mail()函数的具体方法09

如何配置以及实现mail()函数的具体方法09

说明:  第一次最好启用debug.log_file,error_logfile,以查看sendmail是否生效。

重启apache或者IIS


重启之后,mail()函数就可以正常发送邮件了。


道勤主机提供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-14 06:27

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

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