Bizarre mail() problem

From: Date: Sat, 02 Mar 2002 09:04:37 +0000
Subject: Bizarre mail() problem
Groups: php.general 
Request: Send a blank email to php-general+get-86887@lists.php.net to get a copy of this message
I have written a script to do some massmailing - it extracts an email address from a MySQL database and uses it to send a text file as a mail message. It works but there is a 75 second delay between each message being sent out! This is baffling - there are no delays built into the script and nothing obvious in our sendmail configuration. As I've got over 38000 addresses to mail out to, this is a problem - I've got round it for now by running 10 scripts simultaneously, each handling 1000 addresses and this has got mail moving. The mail() function seems to call sendmail -t -i. This just sits there for 75 seconds, then sends a message and then waits for another 75 seconds. Surely this should not happen? Here's the relevant parts of the script - the email address is in column 15 of the MySQL table, so it just extracts field 14 for the email address data: $msg_txt="message.txt"; mysql_connect("localhost",$mysql_user,$mysql_pwd); $query="select * from $table"; $result=mysql($dbname, $query); $rows=mysql_numrows($result); $r=0; $f=14; while ($r < $rows ) { $address=mysql_result($result,$r,$f); mail("$address","$subject","$message","From:$MailFromAddress"); $r++; } Any suggestions or pointers to where I'm going wrong will be warmly received. Andy

« previous php.general (#86887) next »