From: ligiana_s at virgilio dot it
Operating system: Solaris 5.8
PHP version: 5.0.2
PHP Bug Type: Mail related
Bug description: mail function returns nothing or false, but sends mail
Description:
------------
Regular
use of mail() function, 4 parameters...Mail function sends mail, but it
returns false or 'nothing'. I didn't find any error in any logs (php,
apache,sendmail). Server: Solaris 5.8, php 5.0.2 (or 4.3.4 - it doesn't
make difference!), apache 2.0 (xampp).
sendmail_path /usr/lib/sendmail -t -i /usr/lib/sendmail -t -i
PATH /usr/local/bin:/bin:/usr/bin:/usr/sbin:/usr/local/sbin I am not
supposed to change the above PATH, but I've made even something like ln
-sf /usr/lib/sendmail /usr/bin/sendmail
Reproduce code:
---------------
<?php
$r = false;
$fdate = date("d-m-Y"); $subject = "New request - $HTTP_HOST ";
$msg_body = "\nDate: 15 nov 2004 \n";
$headers = "From: [EMAIL PROTECTED]";
$headers .= "X-Priority: 1\n";
$r = @mail("[EMAIL PROTECTED]", $subject, $msg_body, $headers);
if($r)
{
echo "Mail sent";
}
else
{
?> <div align="center" class="main"><p><?php echo
isset($r)."/".empty($r)."/Error"; ?> !!!</b></div>M
<?php
}
?>
Expected result:
----------------
"Mail sent" when the mail was successfully accepted for delivery;
"1/1/Error !!!"
if the mail wasn't sent.
Actual result:
--------------
Sometimes returns "Mail sent", and most of the times returns "1/1/Error
!!!", but in both cases the mail has been sent. I couldn't determine when
is made the diference. I don't find anything in logs.
I wanted to report this on 4.3.4 version, but I saw that I was not allowed
and I upgraded to 5.0.2, as recommended. 5.0.2 made a mess through my
software, one of the problems being the well-konwn "PHP Fatal error:
Cannot re-assign $this in..". I'll get back to 4.3.4, but please let me
know what should I do in order to use the mail() function properly..
--
Edit bug report at http://bugs.php.net/?id=30822&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30822&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=30822&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=30822&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30822&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30822&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30822&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30822&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30822&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30822&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30822&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=30822&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=30822&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30822&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30822&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30822&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30822&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30822&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30822&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30822&r=mysqlcfg