Have you timed it? You might want to check it doesn't take longer than the
max_execution_time directive in php.ini allows (you'll have to check if
that's the correct name for it). I've also used set_time_limit(0) at the top
of my scripts when I know it's going to take a while...

Regards


Chris

-----Original Message-----
From: Trevor Dowling [mailto:[EMAIL PROTECTED]
Sent: 22 September 2003 16:46
To: [EMAIL PROTECTED]
Subject: [PHP] Mail problem


PHP Version 4.3.2
I am having problems sending a large number of emails from a mail list held
in a database. I don't belive that the database has anything to do with the
problem.

I have about 9000 addresses and can only successfully send about 2000 mails
before the page say complete/done.

Below is the code that I am running, no error messages are returned from the
mail function, it just stops. About 2000 mails are sent OK.

Anyone know what the problem is?

Trevor


 $query_string = "SELECT DISTINCT email FROM [user]";
 $result = odbc_exec ($odbc_connection, $query_string);

 $Message = "Mail Text";

 $Index = 0;

 while (odbc_fetch_row ($result))
 {

  $EmailAddress = trim (odbc_result ($result, 'email'));

    flush();
    @mail ($EmailAddress, "Support", $Message);

  $Index++;

  echo ("<BR>Email Address: $EmailAddress");  // DEBUG
  echo ("<BR>ErrorCode: ${ErrorCode}");  // DEBUG
  echo (".........${Index}");     // DEBUG
 }

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
If you are not the intended recipient of this e-mail, please preserve the
confidentiality of it and advise the sender immediately of any error in
transmission. Any disclosure, copying, distribution or action taken, or
omitted to be taken, by an unauthorised recipient in reliance upon the
contents of this e-mail is prohibited. Somerfield cannot accept liability
for any damage which you may sustain as a result of software viruses so
please carry out your own virus checks before opening an attachment. In
replying to this e-mail you are granting the right for that reply to be
forwarded to any other individual within the business and also to be read by
others. Any views expressed by an individual within this message do not
necessarily reflect the views of Somerfield.  Somerfield reserves the right
to intercept, monitor and record communications for lawful business
purposes.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to