There are a couple of spots it may be slowing down depending on how your
doing things. I have a mysql database and submit one query in which I
hold all the data in an array. Then I loop through the array so I do not
need to send multiple queries.

I use something like the following, though I like to stay away from the
mail() function, especially when sending a lot of emails.

$Subject = "This is the subject";
$Message = "This is the message\nand with a second line";
$Query_Result = mysql_query("SELECT `EID`, `Email`, FROM `Emails_Main`")
or die (mysql_error());
while ($CurrentRow = mysql_fetch_row($Query_Result)){
        mail($CurrentRow[1], $Subject, $Message, "From:

Hope this helps.

-----Original Message-----
From: rolf vreijdenberger [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 06, 2002 3:53 PM
Subject: [PHP] Mail(): How much time?

I am getting all my emailadresses for my mailinglist out of a database
in a loop, and in that same loop I personalize the email by adding the
name and a personal URL (script.php?email=youremail). In that loop I
then send the email. This whole process takes about 0.5 to 2 seconds per
adress. This seems quite long to me. It can't be the database query or
the if conditions in the loop, so why is this taking so long?? I don't
have any problems with script execution time as I increment it in every
iteration. This is not a nice solution though. I am also wondering how
many adresses you can put in one subject, Cc or Bcc field?

thanks in advance

Rolf Vreijdenberger
De Pannekoek en De Kale
Maystraat 6
2593 VW Den Haag
T: 06-24245719

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to