phpBB's Failed Sending Email Errors (and how to resolve)

转载 2004年07月16日 10:05:00
Description: This article targets the "failed sending email" error on UNIX and people using PHP's mail() function (not phpBB's SMTP function)
Author: dougk_ff7
Date: Thu Jan 29, 2004 4:15 am
Type: Fix
Keywords: email,sendmail,mail,unix
Category: Installing/upgrading/converting
Recently, I've been playing around with some stuff that uses mail() in PHP, and I know I've hit errors in the past when I've set phpBB to use the mail() function, and I never really figured out why each case was failing. It started when I got the real error from PHP (when another program called mail()) -- "PHP Fatal Error: Call to undefined function mail()" -- looking around for a bit, I found that there are a few things that can cause this. One is simply PHP can't find sendmail, so you need to point it in the right direction using the "sendmail_path" option in php.ini. If that fails to work, you're going to have to do a bit more work. Create a new .php file (for example, phpinfo.php), with only "<?php phpinfo() ?>" (without quotes) in it. Upload this to your server, and view it with your web browser. Look down a bit until you see "sendmail_path" -- I found if this is broken, it usually displays "-t -i" -- the default parameters it uses for sendmail, and nothing else. Ok, so that was kinda pointless. It doesn't tell us very much more. Anyway, now the real reason for creating the phpinfo() file. Please follow these steps *exactly* (or modify slightly for your setup, you'll get the idea):

  • Copy that entire ./configure line up at the top of the phpinfo() page -- it'll make your life much less painful, trust me. Don't worry about the single quotes, they're fine. Just leave them.
  • Check for a working sendmail -- postfix and most other MTAs should provide this, qmail will provide a compatible warpper. Just make sure there's something. /usr/lib/sendmail, /usr/bin/sendmail, and /usr/sbin/sendmail are good bets, as far as I know. If your sendmail is elsewhere, make a symlink back to /usr/sbin/sendmail ("ln -s /path/to/your/sendmail /usr/sbin/sendmail") -- for qmail, that's "ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail"
  • Either grab the latest source of PHP, or find the source you built PHP from (this will require root later on, so if you're on a shared host, see if the problem exists outside of phpBB, and if it does, ask them to work on it for you).
  • If you are using a clean source tree, skip this step. If not, run make clean.
  • Run the ./configure line you just copied, or if you wish, reconfigure php to your liking. Hey, you're going to redo the entire thing, why not do it right?
  • Run make, su to root, and make install.
  • Check php.ini (if you don't know where it is, try "locate php.ini") -- make sure the sendmail_path is correct.
  • Run apachectl stop, followed by apachectl start(ssl)? -- if you use ssl, use startssl, if not, just use start. I found that apachectl restart seems to have some strange quirks, and may just die on you after rebuilding PHP. If you can't find apachectl, try "locate apachectl" or "whereis apachectl" to help you out.
  • Test mail() using a simple script. Unfortunately, I don't have one made. Perhaps [url][/url] would have an idea?

That's it. Hope this helps someone out there!

Good luck!

Android studio更新到2.2之后出现的问题

更新完AS之后去写作业,发现怎么弄都是没法运行,提示的错误是Conflict with dependency ''. Re...
  • sinat_18497785
  • sinat_18497785
  • 2016年05月23日 20:08
  • 10828

Kafka Producer同步模式发送message源码分析

先把几个比较重要的方法列出来 // 入口,处理 message及messages   def handle(events: Seq[KeyedMessage[K,V]]) //处理序列化的K...
  • chrischen214
  • chrischen214
  • 2014年02月25日 18:45
  • 10104


一、IK简介IK Analyzer是一个开源的,基于java语言开发的轻量级的中文分词工具包。从2006年12月推出1.0版开始, IKAnalyzer已经推出了4个大版本。最初,它是以开源项目Lue...
  • zhanlanmg
  • zhanlanmg
  • 2015年09月25日 10:26
  • 3972

Hadoop “Failed to set setXIncludeAware(true) for parser” error and how to resolve it

  • harjolgoo
  • harjolgoo
  • 2013年12月03日 11:01
  • 1013

Java Mail 发送邮件失败问题:Sending the email to the following server failed

转自:  org.apache.commons.mail.EmailExc...
  • liudeleigh
  • liudeleigh
  • 2015年04月03日 09:42
  • 2693

How to: Handle Data Conflicts and Errors 【转载】

MSF(Microsoft Sync Framework)是微软的一套数据同步框架,其中一个典型场景就是实现本地数据库与远程数据库之间的数据同步,这样可以比较容易实现脱机应用程序的架构   有关MSF...
  • chen_xizhang
  • chen_xizhang
  • 2011年05月10日 14:34
  • 503

How to Read and Analyze the Email Header Fields and Information about SPF, DKIM, SpamAssassin

Email Header How to Read and Analyze the Email Header Fields and Information about SPF, DKIM, SpamA...
  • jamex
  • jamex
  • 2012年02月01日 14:07
  • 1098

How to apply a patch/diff and solve “hunk FAILED”, “can’t find file to patch” and others

Hi  After you read this article, you’ll be able to apply patch files/diffs and deal with possible e...
  • jiaweihao
  • jiaweihao
  • 2013年10月25日 10:10
  • 1170

启动Tomcat报错:严重: Context startup failed due to previous errors

启动Tomcat服务器出现如下的信息: log4j:WARN No appenders could be found for logger (org.apache.commons.digester....
  • Chen_yu_ting
  • Chen_yu_ting
  • 2011年12月29日 14:41
  • 5587

关于Context []startup failed due to previous errors有效解决方式

yuan 这两天在搭建struts2+spring+hibernate框架的过程中遇到如题的错误,在百度和谷歌上查了两天,以致快到了崩溃的边缘。最后还是解决了。这个问题的出现,原因有很多,在这总...
  • tyzttzzz
  • tyzttzzz
  • 2014年10月14日 10:05
  • 508
您举报文章: phpBB's Failed Sending Email Errors (and how to resolve)