Re: mail()===false but msg is sent!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andy Pieters wrote:
So what I do is (

$header="header for multipart mime message";
$body="body with multipart mime message";
$result=mail("Name Firstname <$address>","Subject",$message,$header);
echo ($result?"ok":"bogus");

Well, firstly your subject does not match what you're doing. PHP is weakly-typed, so $result may be a value that evaluates to FALSE while not actually being a boolean value.

In your subject you use the === operator to check types, but you're not doing it in the code sample.

You should use

echo ($result === false) ? 'bogus' : 'ok';

or similar.

Jasper

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux