
January 23rd, 2001, 11:50 PM
|
|
Contributing User
|
|
Join Date: Jan 2000
Posts: 54
Time spent in forums: < 1 sec
Reputation Power: 9
|
|
|
The requirement is to be able to send a personalized email to each of several thousand recipients, in either HTML or plain text format.
Currently, the list of addresses is generated by querying a MySQL table using PHP. This list is presented (one address per line) in a textarea form field on a "preview" page and can be modified before actually sending out the emails.
When the preview page is submitted, a confirmation page comes up, and the emails must actually be sent.
Part of the difficulty I'm having is this: while I can use system("./email.cgi&"); to launch a call to the email.cgi script so that it runs in the background while the confirmation page sent.cgi is displayed, the browser doesn't indicate that the page is "completed" until email.cgi finishes. (E.g., in Explorer, the "processing" icon in the upper right continues to be in motion during this time.)
Another part of the difficulty is that of passing the long list of email addresses to the email.cgi script. When I'm just testing, I use a loop to send a certain quantity of emails to an address used for test purposes; however, in reality, I need to pass the actual list to the script. I'm guessing that a list of nearly 10,000 email addresses is too long to pass in an argument list. (I know it would be too long for the environment QUERY_STRING.) Is there a preferred way of conveying a large quantity of data in such a situation? Do I have to save it to a file first, or is there a more direct way?
From a slightly different angle:
Something else I have tried is having the preview page send the form data directly to email.cgi and having email.cgi launch the confirmation page using a system() call. Since the preview page calls the cgi script using the POST method, the amount of data being passed isn't a problem. The problem is that, while the confirmation page does get displayed, the browser doesn't indicate that it's finished loading until the emails have been processed. This might be tolerable for a few emails, but I don't think it's going to work for a large quantity.
Thanks for any suggestions,
Rick
|