mail() error handling

From: Date: Thu, 05 Jun 2008 08:48:08 +0000
Subject: mail() error handling
Groups: php.general 
Request: Send a blank email to php-general+get-275046@lists.php.net to get a copy of this message
Hi. I have a piece of code that uses mail() to, well, send mail. It works, but not the error handling which is as follows: <snip> $send = @mail( $to, $subject, $body, $headers ); if($send) {header( "Location: http://somewhere/thankyou.html" );} else {print "Oops, couldn't deliver the message, please try again soon."; } I checked, and it always returns 1, even though I tried a user@server that doesn't exist! Anyone got a clue what I've done wrong? Kind Regards, Henrik Johansson System Administrator RADIUS Sweden AB

« previous php.general (#275046) next »