Re: best way to log bad email address'
| From: | Mike Mannakee | Date: | Thu, 25 Jul 2002 02:03:15 +0000 |
| Subject: | Re: best way to log bad email address' | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-109400@lists.php.net to get a copy of this message | ||
You'll have to make sure that your headers include a reply-to email address.
Also set up with your server administrator that the outgoing emails from
your site have a correct sender. The mail function's return value only
tells you that it made it to the outgoing mail server. That the server
actually sends it is completely unverified. You could try setting up an
IMAP function that logs onto the mail server and collects the returned mails
for you, automatically deleting them from your database, but I wouldn't have
that run for at least 24 hours after the mail is sent, to make certain to
catch the returns.
Mike
"Justin French" <justin@indent.com.au> wrote in message
news:B9658F22.B426%justin@indent.com.au...
> Hi,
>
> what's the best way to log the bad email address' from a mail() loop?
>
> my guess is:
>
> <?
> $log = '';
> $to = 'me@my.com';
> $subj = 'foo';
> $msg = 'blah';
> $head = 'From: me@my.com';
>
> 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
>