note 23424 added to function.mail

From: Date: Thu, 18 Jul 2002 07:14:44 +0000
Subject: note 23424 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-33236@lists.php.net to get a copy of this message
Although mail returns 0 or 1 (false or true) when it doesn't or does pass the job to sendmail, it is apparent to me that it returns its false or true status based on sendmail's ability to successfully connect to a relay (this is not the same as successfully sending the email) and empty out it's queue. This can be demonstrated in contrast with the following scenarios: 1. Your poor sendmail has the lugubrious task of sending a mail to a hapless recipient at test@hotmail.com. Hey. Try and get a fast connection there. When will your poor little application get it's true or false? Not until the handshake with hotmail.com is terminated. 2. Now have your application send test@test.com (a perfectly formed RFC 822 compliat address). Sendmail is sure to send that mail out fast to a friendlier relay than you'll find at hotmail.com. You get your false or true even if that is a falacious email address. 3. Do the same above in a more localhost situation so you can read your logs. You can observe the behaviour on your *nix box by doing a good old fashioned ps -ax | grep mail and cringe after a minute when you see that sendmail _still_ hasn't negotiated it's bye bye. Just do the ps a few times to get the crawling horror effect. This causes browser timeout issues which set_time_limit() and friends don't seem to be able to solve. If you have a redirect that relies on getting a true from mail(), and the true takes 2 minutes to arrive, you're stuck. Any ideas? Best, Jerry Cornelius -- http://www.php.net/manual/en/function.mail.php http://master.php.net/manage/user-notes.php?action=edit+23424 http://master.php.net/manage/user-notes.php?action=delete+23424 http://master.php.net/manage/user-notes.php?action=reject+23424

« previous php.notes (#33236) next »