Mail() Speed?
| From: | PHP User | Date: | Thu, 05 Apr 2001 21:41:36 +0000 |
| Subject: | Mail() Speed? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-47318@lists.php.net to get a copy of this message | ||
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"
*****************************************************************