Home > Archive > PHP SQL > September 2005 > BCC mail function
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Neil Trigger 2005-09-28, 3:57 am |
| What's the best way to mail a lot of people the same thing (newsletter, not
spam) without them seeing each other's email address? I have around 500
subscribers, but think that if I try BCC for all of them it may crash, if I
try to mail 500 individuals it may just time out.
Any suggestions?
--
Neil Trigger
Magic2k Managing Director
http://www.magic2k.com
http://www.magic2k.co.uk
| |
| J.O. Aho 2005-09-28, 6:58 pm |
| Neil Trigger wrote:
> What's the best way to mail a lot of people the same thing (newsletter, not
> spam) without them seeing each other's email address? I have around 500
> subscribers, but think that if I try BCC for all of them it may crash, if I
> try to mail 500 individuals it may just time out.
There are hosts that don't allow big Bcc, as it's usually thought as spam (my
mail server classes all Bcc as spam).
Depending how you are executing your script, you may or may not have trouble
with the "time out", if from a cron job, then you don't have to worry about
the "time out", if from a web page, then you need to do something to keep the
connection alive, simple solution to this is to have a character sent every
10th mail
for($i=0;$i < $num_members; $i++) {
mail_to($address[$i]);
if(($i/10)=0) {
echo ".";
}
}
This way it shouldn't time out as you will have a "." sent every tenth message
mailed and in the end you should have a line with 50 dots. If you want to
use Bcc, then make smaller groups, maybe 10 in each group, so that SMTPs using
Bcc size limitations won't block.
//Aho
| |
| Neil Trigger 2005-09-28, 6:58 pm |
| Thanks for the reply,
Firstly it seems that I'm unable to use BCC even with three emails (copying
myself in a few times using different addresses as test data).
You think perhaps I need to mail everyone individually?
--
Neil Trigger
Magic2k Managing Director
http://www.magic2k.com
http://www.magic2k.co.uk
| |
| Hilarion 2005-09-29, 7:56 am |
| > Firstly it seems that I'm unable to use BCC even with three emails (copying
> myself in a few times using different addresses as test data).
>
> You think perhaps I need to mail everyone individually?
In my personal opinion as a mailing sender and as a mailing recipient: yes,
you should.
The mail looks much better if it contains recipient address in the "To"
field and helps people who have multiple mail accounts with auto-forwarding
(or multiple aliases on the same mail account) with distinguishing
to which address the mail was sent.
From the sender perspective it's better to treat each recipient individually
because you can personalize the mail contents (you may for example include
the recipient name in the mail body). It does work slower, but it's not
that difficult to create a script / program, that is able to work
within some time limitations.
Hilarion
| |
| Neil Trigger 2005-09-29, 9:56 pm |
| provided it doesn't time out I'm perfectly able and willing to do that.
--
Neil Trigger
Magic2k Managing Director
http://www.magic2k.com
http://www.magic2k.co.uk
"Hilarion" <hilarion@SPAM.op.SMIECI.pl> wrote in message
news:dhgktu$8bp$1@news.onet.pl...
>
>
> In my personal opinion as a mailing sender and as a mailing recipient:
> yes,
> you should.
> The mail looks much better if it contains recipient address in the "To"
> field and helps people who have multiple mail accounts with
> auto-forwarding
> (or multiple aliases on the same mail account) with distinguishing
> to which address the mail was sent.
> From the sender perspective it's better to treat each recipient
> individually
> because you can personalize the mail contents (you may for example include
> the recipient name in the mail body). It does work slower, but it's not
> that difficult to create a script / program, that is able to work
> within some time limitations.
>
>
> Hilarion
| |
| Hilarion 2005-09-30, 7:57 am |
| Neil Trigger <nt018a9036@blueyonder.co.uk> wrote:
> provided it doesn't time out I'm perfectly able and willing to do that.
As I wrote:
[color=darkred]
If you have control over server timeout settings, then you can
turn it off for the mailing script (for example by "set_time_limit"
function). To prevent the browser timeout you'll have to send
some data to the browser periodically. I do it by sending number
of address processed and a total number of addresses after each
e-mail sent (eg. echo $i . '/' . count($addr) . "<br />\n"). You should
also remember to turn off the output buffering or flush the buffers
(because if you do not, then the output will not be sent to the browser).
I also record information about which addresses were already
processed in my DB, so even if the script is terminated (due
to timeout or user intervention), it can be rerun and continue
from the exact place where is stopped. You could also record
that info when the script is stopped (using some handler), but
I find recording all the info "on the fly" more reliable.
Hilarion
|
|
|
|
|