[wplug] PHP mail() problems
Chris Romano
romano.chris at gmail.com
Tue Aug 12 15:18:46 EDT 2008
On Tue, Aug 12, 2008 at 3:08 PM, Paul Oehler <poehler at interworx.com> wrote:
>> I have a CentOS box that runs a few websites and just recently someone
>> wanted to use php's mail() function.
>>
>> So I installed qmail and set it up to just send messages and not act
>> as a mail server so no smtp.
>>
>> I can send messages from the command line and they get delivered;
>> however, the php mail function fails. I'm not seeing any thing in the
>> qmail logs. It seems like php isn't calling the qmail executable.
>
> There's really nothing in the qmail send log at all when you try to send
> from php? Does the php mail command return true or false?
Nope. Nothing at all. The only time info gets sent there is when I
use the cli. The mail command returns false. I don't know how to get
any specific info as to what the failure is. I have this page for
testing.
<?php
$to = 'romano.chris at gmail.com';
$subject = 'the subject';
$message = 'This is a new test';
$headers = 'From: webmaster at rho-technology.com' . "\r\n" .
'Reply-To: webmaster at rho-technology.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if (mail($to, $subject, $message, $headers)) {
print "Mail Sent";
} else {
print "Mail failed";
}
?>
>
> Do you have something special set in the php.ini for the sendmail_path
> variable? If so, try leaving it the default (just comment it out).
>
I've tried the default that was set and I've tried pointing it to the
sendmail wrapper directly (/var/qmail/bin/sendmail).
--
"They that would trade essential liberty for a little temporary safety
deserve neither." -- Benjamin Franklin
More information about the wplug
mailing list