Re: Writing my own mass-email script in PHP

From: Manuel Lemos (mlemos_at_acm.org)
Date: 09/27/04


Date: Mon, 27 Sep 2004 14:35:23 -0300

Hello,

On 09/27/2004 01:22 PM, Jeffrey Silverman wrote:
> I tried using the PHP mail() function and it *seemed* to work, almost.
> That is to say, I had added all the names to a long list of Bcc: headers,
> and put the extra Bcc: headers in the extra headers argument to the PHP
> mail() function. This seemed to work, in that it seemed like everyone got
> the email; however, the mail() function came back with a failure error.
>
> I thought about it a bit and researched a little and found that maybe a
> really long Bcc: list is not the best idea, for spam reasons (my
> message is more likely to be marked as spam) and for other similar
> reasons. So I was considering looping through the 500 email addresses and
> doing a separate mail() for each, but putting each email address in the
> To: field. This sounds like a lot of overhead, though, and I'm afraid of
> this thing timing out or crapping out or Something Bad(TM) happening.
>
> I am currently using Sendmail, Linux (Red Hat 9), Apache 1.3.x, and PHP
> 4.3.8.

You are right. Putting all recipients in Bcc: is not a good idea because
like you noted, some mailbox providers like Hotmail will tag the
messages as junk when the recipient address does not come in a visible
header (To: or Ccc:). Some ISP may also limit the number of recipients
per message that is queued.

Since you use sendmail and your messages are not that urgent, my
suggestion is to configure it to queue all the messages and deliver them
later when the queue is processed next time. This way sendmail will not
hold your PHP script waiting for each delivery.

If you are not aware how to do that, you may want to try this class for
composing and sending e-mail messages that comes with a subclass
specialized in deliveryng via sendmail that provides an option that lets
you tell to defer the delivery of your messages.

If you are not personalizing the messages (which I strongly advise for
efficiency reasons) you may also want to tell the class to cache your
message bodies so it does not waste time rebuilding the message body for
each recipient. You can still personalize the message headers like the
To: header as you need.

http://www.phpclasses.org/mimemessage

-- 
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html


Relevant Pages

  • Re: Preventing the use of CC: in outlook express.
    ... You will have an icon on your Desktop now with, depending on how you set it up, that when clicked on will open a new message window with the To and BCC fields already filled in. ... recipients don't want their email address made available to others. ... Potentially, something could be done at your SMTP mail server, assuming ... addresses or even strip or truncate the headers. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Large-scale multi-user mailing list
    ... As I explained in another message, if you put the recipients in Bcc, ... You need to send messages with recipients in visible headers To or Cc. ... messages be considered SPAM is to send them separately to each ... at least ezmlm can be tied to a mysql database and used with php. ...
    (comp.lang.php)
  • Re: Preventing the use of CC: in outlook express.
    ... Forgot to add the Group and BCC instructions. ... To use the BCC feature, In Create Mail, either click View | All Headers and type in the addresses separated by a; ... (Some ISPs require a legitimate address in the To line, and the recipients will know it is from the group). ... Potentially, something could be done at your SMTP mail server, assuming ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Writing my own mass-email script in PHP
    ... I have written a simple HTML interface and PHP backend to process the ... That is to say, I had added all the names to a long list of Bcc: headers, ... I am not crazy about the idea of installing EZMLM only because I would ...
    (alt.os.linux)
  • Writing my own mass-email script in PHP
    ... I have written a simple HTML interface and PHP backend to process the ... That is to say, I had added all the names to a long list of Bcc: headers, ... I am not crazy about the idea of installing EZMLM only because I would ...
    (comp.unix.admin)