FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


php mail and BCC





steveadams617
Hi. I'm going to be sending about 35 identical emails 2 times a month from a script using the PHP mail() function:

http://us2.php.net/manual/en/function.mail.php

Is it better form to loop through and call the function 35 times or build the addresses into the BCC in the header. Is one easier on the mail server than the other in the long run? How many can I put into BCC at a time?

Thanks. (This is opt in mail to people I know very well)
nunosilva
I'm not quite familiar with php mailing, but if BCC is an array I guess you can put the whole 35...
in terms of performance too, BCC would be faster than looping to send 35 mails...
If you use linux, create a program that prints 35 words in one shot, and other that prints the 35 words in a loop... than run the program with the command time before the executable. Something like:

time java File


it will give you:

real 0m1.453s
user 0m0.051s
sys 0m0.009s

(this output was generated when I entered "time java")

hope this is somewhat helpful...
Cejuana
LoL!

It would definately be alot easier on the mail server if you entered them into the BCC. Not to mention more secure, since your inserting them into the header.

Like nunasilva said, it might work to make an array that automatically updates itself when you add a new email address to the list. That way you can just have it copy anything from the array directly to the BCC.

Theres also the option of using flat files. You can create a .txt or .rtf that has all the emails encrypted, and have another .php page that decrypts them and throws them into the BCC. It may take some time, but it'd be more secure and fast.
steveadams617
I thought maybe the mail server had to do the same amount of work of sending out x number of email regardless of how the request was made. Does anyone know? Or does it just send one request out into cyberland and the machines that process email send it to all the BCC's?
kv
steveadams617 wrote:
I thought maybe the mail server had to do the same amount of work of sending out x number of email regardless of how the request was made. Does anyone know? Or does it just send one request out into cyberland and the machines that process email send it to all the BCC's?


True. Mail server has to do the same amount of work to send out the mails regardless of whether it is bcc or loop. The difference is that it is easier to maintain it on php side if it is bcc. On the downside, bcc makes everybody know that they are one among a big list where as looping gives the feeling the mail is personalised to them.
nunosilva
Quote:
bcc makes everybody know that they are one among a big list where as looping gives the feeling the mail is personalised to them.


I'd don't agree with the
Quote:
bcc makes everybody know that they are one among a big list


bcc simply hides the other contacts from the receivers...

right?
kv
It does. But when I receive a bcc, I know that several others are hidden. Which means that i am not the only one to whom the mail is sent. Or else, why would somebody bcc. So there SHOULD be a list. In contrast, if your mail id is in TO, you know all the people in the list, even if they are in bcc. This way, if you receive a TO mail, if gives a "personalised mail" feeling.
Related topics
PHP Mail Function
PHP mail function ?
Does FriHost support php mail?
Php mail function
Envoi de mail via PHP sur frihost
Can You Get HTML in Your PHP Mail Script?
PHP Mail
PHP Mail - Always Junked?
how to config php ini for mail locally
PHP mail() Function
SMTP, sendmail e PHP mail function
Php mail
Webmail, not PHP Mail, has never worked for me...
php mail(); problem... half fixed?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.