[PHP] Re: how to debug mail() problem?

2002-07-30 Thread Lee Doolan

> "Manuel" == Manuel Lemos <[EMAIL PROTECTED]> writes:
   [. . .]

Manuel> Anyway, if all else fails, you may want to try to use this
Manuel> class:

Manuel> http://www.phpclasses.org/smtpclass

Manuel> maybe in conjunction with this

Manuel> http://www.phpclasses.org/mimemessage

Just by way of affirmation, here --as _though_ it were actually needed-- 
I've been using the smtpclass for a while now.  It rocks.

-lee

-- 
When the birdcage is open,   | donate to causes I care about: 
the selfish bird flies away, |http://svcs.affero.net/rm.php?r=leed_25
but the virtuous one stays.  |

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




[PHP] Re: how to debug mail() problem?

2002-07-30 Thread Manuel Lemos

On 07/30/2002 01:27 PM, Kevin Porter wrote:
> Hi,
> 
> 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)";
> 
> if ( !mail( $r->Email, "Subject", $message, $headers ) )
> echo "Failed to send email to $r->FirstName $r->LastName
> ($r->Email)";
> }
> -- 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.
> thanks,

Mail() has a track record of being very buggy, especially under Windows.

 From that error message it seems that it is getting an unexpected 
response from your server on the QUIT SMTP command.

Anyway, if all else fails, you may want to try to use this class:

http://www.phpclasses.org/smtpclass

maybe in conjunction with this

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