PhpBB ' s Failed sending Email Errors (and how to resolve)

Source: Internet
Author: User
Tags phpinfo qmail
Description: This is article targets the "failed sending email" error on UNIX and people using PHP's Mail () function (not PhpBB's SMTP fun ction)
Author: dougk_ff7
Date: Thu, 4:15 am
Type: Fix
Keywords: Email,sendmail,mail,unix
Category: Installing/upgrading/converting
Recently, I ' ve been playing around with some stuff-uses mail () in PHP, and I know I ' ve hit errors to the past when I ' ve set PhpBB to use the mail () function, and I never really figured out why the all case is 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 the can cause this. One is simply PHP can ' t find SendMail, so you need to point it's right direction using the ' sendmail_path ' option in PHP.ini. If that's 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 "Sendmail_path"--I found if it broken, it usually displays "-t-i"--The default par Ameters 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 this steps *exactly* (or modify slightly for your setup, and you'll get the idea):

Copy that entire/configure line up on the top of the Phpinfo () page--it's 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 the other MTAs should the this, provide would qmail a provide compatible. 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 for your built PHP from (this'll require root later on, so if you ' re On a shared host, if the problem exists outside of PhpBB, and if it does, ask them.
If you are are using a clean source tree, skip this step. If not, run make clean.
Run the./configure line for you just copied, or if your wish, reconfigure PHP to your liking. Hey, you ' re going to redo the entire thing, why does it right?
Run make, Su to root, and make install.
Check php.ini (if 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 Use SSL, use STARTSSL, if not, just use start. I found that apachectl restart seems to have some strange quirks, and could just die on your 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]php.net[/url] would have a idea?


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

Good luck!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.