Re: [PHP] best way to log bad email address'
On Thu, 25 Jul 2002, Justin French wrote: what's the best way to log the bad email address' from a mail() loop? From the manual: mail() returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise. Is the definition of accepted for delivery dependent on each server, or is there are general definition of what it means? In almost every case, mail() will return true, regardless of how bogus the destination email address is. mail() just dumps it into the mail queue. There's a lot that goes on between there and delivery, and mail() doesn't wait around. You'll need to catch bounces as they come in. To make life easier, assign your own unique Message-IDs and remember them, so you can easily invalidate addresses. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] best way to log bad email address'
on 25/07/02 5:37 PM, Miguel Cruz ([EMAIL PROTECTED]) wrote: In almost every case, mail() will return true, regardless of how bogus the destination email address is. mail() just dumps it into the mail queue. There's a lot that goes on between there and delivery, and mail() doesn't wait around. That's what I figured/feared :) You'll need to catch bounces as they come in. To make life easier, assign your own unique Message-IDs and remember them, so you can easily invalidate addresses. Erm, I'm on a shared server, so I don't *think* it's that easy unfortunately -- I can't get a message to bounce to the From: or Reply-To: headers I set. My guess is it goes to an address set in php.ini, or somewhere else, and is global to the entire server (doesn't help me). Unless I can set it was .htaccess or ini_set(). TIA Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] best way to log bad email address'
Hello, On 07/25/2002 05:27 AM, Justin French wrote: You'll need to catch bounces as they come in. To make life easier, assign your own unique Message-IDs and remember them, so you can easily invalidate addresses. Erm, I'm on a shared server, so I don't *think* it's that easy unfortunately -- I can't get a message to bounce to the From: or Reply-To: headers I set. My guess is it goes to an address set in php.ini, or somewhere else, and is global to the entire server (doesn't help me). Unless I can set it was .htaccess or ini_set(). You do not need to set the return-path/envelop sender address in php.ini . There are ways to work around that. It depends on the platform that you use, but in general you can use this class for that purpose. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] best way to log bad email address'
Hi, what's the best way to log the bad email address' from a mail() loop? my guess is: ? $log = ''; $to = '[EMAIL PROTECTED]'; $subj = 'foo'; $msg = 'blah'; $head = 'From: [EMAIL PROTECTED]'; if(!mail($to,$sub,$msg,$head)) { $log .= {$to}\n; } // write $log to screen, or to a file ? But I'm interested in people's experience with what mail() returns: From the manual: mail() returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise. Is the definition of accepted for delivery dependent on each server, or is there are general definition of what it means? ie, when am I likely to get a returned value of FALSE? Also, I'm on a shared server. Is there any way I can specify the email address that bounces return to with either an ini_set or with an email header? Because my assumption is that there will be email address' that return TRUE, but later bounce. Can't see what it might be in the php.ini file though. Thanks in advance, Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php