php发送错误日志邮件

①去网上可以发送邮件的应用程序,我是在windows系统下,找到了一个叫“sendmail.exe”的文件,下载时去官网下 ,里面不仅有exe执行程序,还有种种配置。

②配置:在 sendmail.ini文件中,我们以QQ邮箱为例。

smtp_server=smtp.qq.com

smtp_port=465

smtp_ssl=auto

error_logfile=error.log

auth_username=291522145(邮箱账号)

auth_password=saturday123456(邮箱 密码)

force_sender=291522145@qq.com

③配置php.ini:

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.qq.com

sendmail_from = 291522145@qq.com

sendmail_path ="i:\abc\sendmail\sendmail.exe -t"

mail.add_x_header = On

④php程序:

<?php
ini_set('display_errors',0);
error_reporting(-1);
ini_set('log_errors',1);
error_log('today ids rain',1,'291522145@qq.com');

所有配置好后,重启服务,然后运行php程序,就能 发现你的 qq邮箱里多了一封邮件。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值