mirror of
https://github.com/php/php-src.git
synced 2026-03-26 17:22:15 +01:00
Prior to this commit the exit code of the sendmail command, called by the mail function was lost, since the mail function only returns true or false. Add additional logging to the mail function to capture the exit code when the sendmail command fails.
29 lines
605 B
PHP
29 lines
605 B
PHP
--TEST--
|
|
Test mail() function : basic functionality
|
|
--INI--
|
|
sendmail_path="exit 1"
|
|
--SKIPIF--
|
|
<?php
|
|
if(substr(PHP_OS, 0, 3) == "WIN")
|
|
die("skip Won't run on Windows");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
echo "*** Testing mail() : basic functionality ***\n";
|
|
|
|
|
|
// Initialise all required variables
|
|
$to = 'user@example.com';
|
|
$subject = 'Test Subject';
|
|
$message = 'A Message';
|
|
|
|
echo "-- failure --\n";
|
|
var_dump( mail($to, $subject, $message) );
|
|
?>
|
|
--EXPECTF--
|
|
*** Testing mail() : basic functionality ***
|
|
-- failure --
|
|
|
|
Warning: mail(): Sendmail exited with non-zero exit code 1 in %smail_basic5.php on line %d
|
|
bool(false)
|