I haven't worked with PHP mail for a while, but since no one has responded
I'll give you something to consider:

1. Why don't you try error suppression , @ ? or you can set error_reporting
down or you can capture all output by using output buffering.
2. You can trap the invalid email, but it may be *more* complex and result
in a slower script. You will have to evaluate this for yourself,

$emails = array (); #array of email info
# In the form
# $emails[0] = array (email => mailto:'[EMAIL PROTECTED]' , name => 'Reciever
Name');
# $emails[1] = array (email => mailto:'[EMAIL PROTECTED]' , name => 'Reciever Name
2');

$invalid_emails = array();
foreach ($emails as $index => $info){

    $result = @mail ($info['email'], 'Bulk Newsletter Subject', 'email
messafge') ;
    if (!$result) {
        $invalid_emails [] = $info['email']; // capture invalid email
    }
}

Please note, that the code above will call mail once for each email, so if
you have 100 emails this will run 100 times, where as if you stacked all the
emails into one mail call. But then you may not be able to find the invalid
emails.




"Irvin Amoraal" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am using the PHP mail() function to send subscribed-to bulk email. It
> successfully sends emails to the valid email addresses, but I get a series
> of error messages at the top of the PHP page like:
> /home/[my folder]/dead.letter... Saved message in
> /home/[my folder]/dead.letter 123... User unknown
>
> I'm almost positive the error msgs are caused by invalid email addresses
> that are stored in the database.
>
> I have two questions:
> 1. How can I suppress the error msg's? @mail....?
> 2. Can the error be trapped and the invalid email address captured to be
> spit out in code?
>
> Thanks for your help.
>
> Irvin.
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to