Many people seem to sware that opening a direct connection to sendmail is
faster than using the mail function, and often avoids errors more often.

Your mileage may vary, but I gather that a direct connection is faster,
though not by much so don't get too concerned, than using mail.

So feel free to use either one.


--
Plutarck
Should be working on something...
...but forgot what it was.


""PHP User"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Would opening a direct connection to sendmail be a bad thing to do in
terms of speed and server time?
> Right now I loop through an array of email addresses, and just send them
each out with mail() would something like this be better or worse in terms
of the amount of time and resources it uses on the server?
>
> <?
> function send_mail($to, $from, $subject, $body) {
> $path_to_sendmail = "/usr/sbin/sendmail";
> $fp = popen("$path_to_sendmail -t", "w");
> $num = fputs($fp, "To: $to\n");
> $num += fputs($fp, "From: $from\n");
> $num += fputs($fp, "Subject: $subject\n\n");
> $num += fputs($fp, "$body");
> pclose($fp); if ($num>0) { return 1; } else { return 0; } }
> ?>
>
>
> *****************************************************************
> Sign up for these FREE offers and have the chance to win money and prizes!
> Click Here http://winwith.chek.com/promotions.php3?partnerid=7"
> *****************************************************************
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to