note 74340 added to function.mail

From: Date: Fri, 06 Apr 2007 12:14:49 +0000
Subject: note 74340 added to function.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-125142@lists.php.net to get a copy of this message
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); .... ---- Server IP: 69.147.83.197 Probable Submitter: 62.135.22.131 ---- Manual Page -- http://www.php.net/manual/en/function.mail.php Edit -- https://master.php.net/note/edit/74340 Del: integrated -- https://master.php.net/note/delete/74340/integrated Del: useless -- https://master.php.net/note/delete/74340/useless Del: bad code -- https://master.php.net/note/delete/74340/bad+code Del: spam -- https://master.php.net/note/delete/74340/spam Del: non-english -- https://master.php.net/note/delete/74340/non-english Del: in docs -- https://master.php.net/note/delete/74340/in+docs Del: other reasons-- https://master.php.net/note/delete/74340 Reject -- https://master.php.net/note/reject/74340 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#125142) next »