[PHP] Many email... and just one mail function

2001-04-20 Thread Marian Vasile

Guyz I have a huge database wih emails.
Now I want to send them news weekly and I can't how I can send many
emails using mail() function ???
but in a faster manner that ussualy ?... is that possible ?

I'm not talking about SPAM here... I have registered users... :)

How I can send all these 30.000 email addresses ?


Marian Vasile
IT Manager
Schnecker van Wyk  Pearson
www.investments.ro
+40 (0) 1 2309000


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Many email... and just one mail function

2001-04-20 Thread Steve Werby

"Marian Vasile" [EMAIL PROTECTED] wrote:
 Guyz I have a huge database wih emails.
 Now I want to send them news weekly and I can't how I can send many
 emails using mail() function ???
 but in a faster manner that ussualy ?... is that possible ?

 I'm not talking about SPAM here... I have registered users... :)

 How I can send all these 30.000 email addresses ?

With 30,000 users I recommend using a mailing list so your mail server can
do the heavy crunching.  Since you probably run PHP as an Apache module and
I suspect your user database changes here are a couple of options to
consider.

1. Create a cron job to periodically pull the email addresses from the DB
and dump them into a text file that the MLM (mailing list manager) expects
(may require an additional step depending on your MLM).

2. Install PHP as a CGI and have it do the same as in option 1, but do
directly from your PHP script that sends the email.  I say CGI so you can
make the script owned by any user you prefer and don't have to make the
directory containing the file world writable/readable.

If you choose not to go one of these routes you can try grouping email
addresses together (perhaps 50 at a time) and batch listing them in the bcc
header.  You'll likely have to increase PHP's timeout setting in php.ini or
within the script itself.  I don't recommend this method b/c it will be
*much* slower and you will not be able to take advantage of some of the nice
features of your MLM that you should really use for a list this large.  FYI,
there are also methods for accessing SMTP directly (which avoids the mail()
function completely).  I know there's a class at
http://phpclasses.upperdesign.com/ and there are others elsewhere.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]