note 23424 deleted from function.mail by nicos
| From: | nicos@php.net | Date: | Fri, 03 Jan 2003 20:18:22 +0000 |
| Subject: | note 23424 deleted from function.mail by nicos | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-41627@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