RE: [PHP] Mail(): How much time?
| From: | Charles Bronson | Date: | Fri, 06 Dec 2002 21:04:24 +0000 |
| Subject: | RE: [PHP] Mail(): How much time? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-127330@lists.php.net to get a copy of this message | ||
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:
me@there.com\r\n");
}
Hope this helps.
Bronson_AT_udatasystems.com
-----Original Message-----
From: rolf vreijdenberger [mailto:rolfvreijdenberger@hotmail.com]
Sent: Friday, December 06, 2002 3:53 PM
To: php-general@lists.php.net
Subject: [PHP] Mail(): How much time?
Hi,
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
E: rolf@depannekoekendekale.nl
W: www.depannekoekendekale.nl
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php