I have a loop that sends out a numbers of emails using the mail() function.

-- Code start ---------------------
    for ( $i=0, $j=count($responders); $i < $j; $i++ )
        $r = $responders[$i];

        $headers  = "MIME-Version: 1.0\r\n";
        $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

        $headers .= "From: $r->FirstName $r->LastName <$r->Email>\r\n";

        echo "sending email to $r->FirstName $r->LastName ($r->Email)<br>";

        if ( !mail( $r->Email, "Subject", $message, $headers ) )
            echo "Failed to send email to $r->FirstName $r->LastName
-- Code end ----------------------

$responders is an array of Responder objects - a Responder object has Email,
LastName, FirstName member variables.

My problem is that although the email is sent on each iteration and reaches
it's intended recipient, I get the "Failed to send email ...." message on
every loop!

Anyone know why? mail() is obviously returning false, but the manual says
"mail() returns TRUE if the mail was successfully accepted for delivery,
FALSE otherwise". Yet it _must_ have been successfully accepted for
delivery, because the emails always get delivered.
Any help would be appreciated.

- Kev

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

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

Reply via email to