note 74340 rejected from function.mail by bobby

From: Date: Fri, 06 Apr 2007 14:42:19 +0000
Subject: note 74340 rejected from function.mail by bobby
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-125147@lists.php.net to get a copy of this message
Note Submitter: mohamed dot abdelsalam dot 86 at gmail dot com ---- This is a question about Drupal CMS v5.x. The problem is simply that i want to send email notification to every registered user when a new file has been uploaded using the normal drupal core upload module. My Approach was to simply use the drupal_mail() function in the upload_save() function inside the upload.module file to send the email to a large list of emails resulting from querying the database users tables ( above 500 record ). When doing so, i got an internal server error and i think it is because the very large number of emails i requested to send in one function call. So should i split the sending process to batches of 50 emails for example to decrease the load or use cron jobs and if so, how or use any other approach? Here is the code modification i made: ..... $res = db_query("select mail from users"); while($row = mysql_fetch_assoc($res)) drupal_mail(1,$row['mail'],"New File Upload Notification",$bdy,"web-master@fci-students.com",$hdrs); ....

« previous php.notes (#125147) next »