dongzhong8691 2012-02-06 22:43
浏览 15
已采纳

禁用自动电子邮件日志

I am using PHP mail() function to send a mail based on my MySQL query result from a cron job at every minute interval.

All is ok, but it creates a log file for each mail automatically. Which exceeds disk space after each 2-3 days.

I haven't configured any setting for sending mails.

How can I can disable this automatic logging?

  • 写回答

1条回答 默认 最新

  • douhui2307 2012-02-09 14:56
    关注

    It's generally not a good idea to call PHP's mail() function yourself since there are so many things you can do wrong leading up to that - use a wrapper like PHPMailer or SwiftMailer instead.

    With that in place, it's possible to use their SMTP classes directly meaning emails will not go through the local mail server and thus not get logged.

    As Gryphius said, you should be rotating/compressing logs anyway - though I'm surprised if you're not since most OS packages for postfix/exim/sendmail have that already set up. Also you must have very little disk space if you're running out so quickly!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?