From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from plane.gmane.org ([80.91.229.3]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1UnRzM-0004cf-6y for ptxdist@pengutronix.de; Fri, 14 Jun 2013 13:16:17 +0200 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UnRzH-0003rt-2d for ptxdist@pengutronix.de; Fri, 14 Jun 2013 13:16:11 +0200 Received: from 121.75.146.251 ([121.75.146.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 14 Jun 2013 13:16:11 +0200 Received: from dave_festing by 121.75.146.251 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 14 Jun 2013 13:16:11 +0200 From: Dave Festing Date: Fri, 14 Jun 2013 11:15:53 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Subject: Re: [ptxdist] PTXdist PHP5 CLI mail() Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de writes: > > dave_festing@... wrote: > > > Have been struggling with trying to get PHP's mail() to work [...] > > Appreciate any suggestions as to the apparently fundamental mistake > > I am making. > > The fundamental mistake is not checking the debug log output to find the > real reason *why* the call to mail() fails. Crank up the log level for > PHP, > and see what it tells you. You might be having no sendmail binary in the > expected path, or some other file system permission problem that prevents > mail() to do it's job. > > What you may not know is that PHP's mail() function usually uses an > external binary ("/usr/bin/sendmail") to drop the mail into the locally > running, completely independent MTA. This obviously allows for many things > to go wrong on the way. Check the PHP debug log, then the MTA's logs if > delivery somehow fails. > > No MTA running locally? Try using PHP's SMTP features directly with a > remote > MTA instead, or install a simple forwarding MTA, depending on your > requirements. > > In either case, this is much more of a PHP/MTA configuration issue, > and likely nothing ptxdist-specific. > > Best regards, > Dennis > > Dennis, I should have stated that I am running msmtp as the local MTA. I keep an eye on the log files. The main issue with mail() is that it doesn't return useful error messages. With the CLI version I get a mail.log message that confirms that mail() has been sent, whilst with the web-based version there is no such indication plus no PHP_errors either. PHPmailer as least returns some information. As long as there is nothing wrong with using PHP with CLI enabled in PTXdist 2012.12.0 for my web-page requirement I will look elsewhere. I will read up on your suggestions. Thank you, Dave -- ptxdist mailing list ptxdist@pengutronix.de