Mail problem
| From: | Trevor Dowling | Date: | Mon, 22 Sep 2003 16:46:21 +0000 |
| Subject: | Mail problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-163498@lists.php.net to get a copy of this message | ||
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
}