1.  many providers will not accept email messages with horrendous amounts of 
BCC: entries (very spam indicative)
2.  do not use mail() to do this
3.  there are many excellent PHP mail classes (PHPClasses has a few and 
PHPMailer is an excellent alternative as well)
4.  IM(H)O, if you are going to send out large amounts of mail, dump sendmail.  
QMail is much faster at SMTP.

Factors you may need to consider:
If this is a newsletter, why not use something like ezmlm or majordomo?  
Are these individualized messages (custom inserts for names or email addresses, 
custom unsubscribes, etc.)?

Many other programmers will mention things like having a dedicated outbound-
SMTP machine, while fending the bounces and unsubscribes on another, hardware 
types (SCSI over IDE), etc.  Make sure you have thought your application needs 
through before beginning programming.

Quoting Mohanaraj <[EMAIL PROTECTED]>:

> Dear all,
> 
> I have read that using mail() in a for loop to send a lot of emails (
> around 1k-10k ) emails is not advised due to the fact that it can be
> resource intensive hence or the script might take so much time that it
> ti,es out. However what if i append all the emails into the Bcc: header
> as follows and make only 1   call to mail.
> 
> 1. Is this better?
> 2.Will it still be resource hungry?
> 3.What would be the best way to handle mailing to many email addresses
> from PHP. This is for a newsletter (not SPAM) application I am working on.
> 4.How does this compare against using sockets to directly speak to the
> SMTP server from a efficiency aspect?
> 
> The code I am planning on using (which I got online too ) is as follows :
> 
> $email = "[EMAIL PROTECTED]";
> $subject = "test";
> 
> $body = "This is a test.";
> 
> $headers = "From: [EMAIL PROTECTED]";
> $headers .= "Reply-to: [EMAIL PROTECTED]";
> 
> //the following willl have all the email addresses which will receive
> the email
> 
> $headers .= "Bcc: [EMAIL PROTECTED]";
> $headers .= "Bcc: [EMAIL PROTECTED]";
> $headers .= "Bcc: [EMAIL PROTECTED]";
> $headers .= "Bcc: [EMAIL PROTECTED]";
> $headers .= "Bcc: [EMAIL PROTECTED]";
> //..and so on...
> 
> $headers .= "Content-Type: text/plain; charset=iso-8859-1\n";
> 
> mail ($email, $subject, $body, $headers);
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=======================================
Michael Geier
CDM Sports, Inc. Systems Administration
   email: [EMAIL PROTECTED]
   phone: 314.692.3540

-----------------------------------------------
 This email sent using CDM Sports Webmail v3.1
              [ http://webmail.cdmsports.com ]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to