Re: Mail problem
| From: | Bug Hunter | Date: | Tue, 27 Jun 2000 13:58:09 +0000 |
| Subject: | Re: Mail problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3336@lists.php.net to get a copy of this message | ||
On Mon, 26 Jun 2000, Chris wrote:
> Hi,
> I am trying to send out an email to about 2500 users that are stored in a
> Mysql database.
> It doesn't quite work though, it will send them in bunches, then I will get
> a few of the error:
> Warning: Could not execute mail delivery program in
> /home/httpd/html/web/index.asp on line 194
>
> Then it will work for a while then back to the errors. I know the email it
> is trying to send to are good. And it allways fails at different points
> anyway.
Yes. Sendmail by default will stop working once system load goes over
10. You need a pause between each statement. sleep(seconds)
You also need to change your max execution time. set_time_limit(seconds)
>
> Is the webserver trying to send email faster than sendmail can handle it?
> Should I be inserting a time delay before each mail command?
> Or is there a better way to do this:
>
> $strsql = "SELECT Name, Email FROM db";
> $result = mysql_db_query("userdb",$strsql);
> $numrows = mysql_num_rows($result);
> for($i=0;$i<$numrows;++$i)
> {
> blah, blah
>
> mail($mailto, $mailsubject, $mailmessage, $mailfrom);
> }
>
>
> Thanks,
> Chris
>